Merge pull request #1902 from iexavl/fullscreen_panic_fix
Fullscreen request unreachable code crash
This commit is contained in:
commit
ef14b7e294
3 changed files with 35 additions and 15 deletions
|
|
@ -262,6 +262,7 @@ pub struct PendingLayer {
|
|||
pub struct Shell {
|
||||
pub workspaces: Workspaces,
|
||||
|
||||
// Can't make this into a HashSet. See https://github.com/pop-os/cosmic-comp/pull/1902
|
||||
pub pending_windows: Vec<PendingWindow>,
|
||||
pub pending_layers: Vec<PendingLayer>,
|
||||
pub pending_activations: HashMap<ActivationKey, ActivationContext>,
|
||||
|
|
|
|||
|
|
@ -44,13 +44,21 @@ impl XdgShellHandler for State {
|
|||
fn new_toplevel(&mut self, surface: ToplevelSurface) {
|
||||
let mut shell = self.common.shell.write();
|
||||
let seat = shell.seats.last_active().clone();
|
||||
let window = CosmicSurface::from(surface);
|
||||
shell.pending_windows.push(PendingWindow {
|
||||
surface: window,
|
||||
seat,
|
||||
fullscreen: None,
|
||||
maximized: false,
|
||||
});
|
||||
|
||||
if shell
|
||||
.pending_windows
|
||||
.iter()
|
||||
.find(|w| &w.surface == &surface)
|
||||
.is_none()
|
||||
{
|
||||
let surface = CosmicSurface::from(surface);
|
||||
shell.pending_windows.push(PendingWindow {
|
||||
surface,
|
||||
seat,
|
||||
fullscreen: None,
|
||||
maximized: false,
|
||||
})
|
||||
}
|
||||
// We will position the window after the first commit, when we know its size hints
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -808,14 +808,20 @@ impl XwmHandler for State {
|
|||
*context,
|
||||
);
|
||||
}
|
||||
|
||||
let surface = CosmicSurface::from(window);
|
||||
shell.pending_windows.push(PendingWindow {
|
||||
surface,
|
||||
seat,
|
||||
fullscreen: None,
|
||||
maximized: false,
|
||||
});
|
||||
if shell
|
||||
.pending_windows
|
||||
.iter()
|
||||
.find(|w| w.surface == window)
|
||||
.is_none()
|
||||
{
|
||||
let surface = CosmicSurface::from(window);
|
||||
shell.pending_windows.push(PendingWindow {
|
||||
surface,
|
||||
seat,
|
||||
fullscreen: None,
|
||||
maximized: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn map_window_notify(&mut self, _xwm: XwmId, surface: X11Surface) {
|
||||
|
|
@ -875,6 +881,11 @@ impl XwmHandler for State {
|
|||
let seat = shell.seats.last_active().clone();
|
||||
if let Some(pending) =
|
||||
shell.unmap_surface(&window, &seat, &mut self.common.toplevel_info_state)
|
||||
&& shell
|
||||
.pending_windows
|
||||
.iter()
|
||||
.find(|w| &w.surface == &pending.surface)
|
||||
.is_none()
|
||||
{
|
||||
shell.pending_windows.push(pending);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue