diff --git a/src/shell/mod.rs b/src/shell/mod.rs index f385dc07..95a60c7b 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -2832,7 +2832,8 @@ impl Shell { surface: &S, seat: &Seat, toplevel_info: &mut ToplevelInfoState, - ) where + ) -> Option + where CosmicSurface: PartialEq, { for set in self.workspaces.sets.values_mut() { @@ -2890,15 +2891,16 @@ impl Shell { if let Some(surface) = surface { toplevel_info.remove_toplevel(&surface); - self.pending_windows.push(PendingWindow { + return Some(PendingWindow { surface, seat: seat.clone(), fullscreen: None, maximized: false, }); - return; } } + + None } pub fn move_current( diff --git a/src/wayland/handlers/xdg_shell/mod.rs b/src/wayland/handlers/xdg_shell/mod.rs index 56efd92e..43e6a46d 100644 --- a/src/wayland/handlers/xdg_shell/mod.rs +++ b/src/wayland/handlers/xdg_shell/mod.rs @@ -321,7 +321,7 @@ impl XdgShellHandler for State { let output = shell .visible_output_for_surface(surface.wl_surface()) .cloned(); - shell.unmap_surface( + let _ = shell.unmap_surface( surface.wl_surface(), &seat, &mut self.common.toplevel_info_state, diff --git a/src/xwayland.rs b/src/xwayland.rs index 9f65445c..2cd789de 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -873,7 +873,11 @@ impl XwmHandler for State { shell.override_redirect_windows.retain(|or| or != &window); } else { let seat = shell.seats.last_active().clone(); - shell.unmap_surface(&window, &seat, &mut self.common.toplevel_info_state); + if let Some(pending) = + shell.unmap_surface(&window, &seat, &mut self.common.toplevel_info_state) + { + shell.pending_windows.push(pending); + } } let outputs = if let Some(wl_surface) = window.wl_surface() {