diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/xdg_shell.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index d99fbdf0..a99b344f 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -158,11 +158,18 @@ impl XdgShellHandler for State { return; } - let (window, output) = self + let win_out = self .niri .layout - .find_window_and_output(surface.wl_surface()) - .unwrap(); + .find_window_and_output(surface.wl_surface()); + + let Some((window, output)) = win_out else { + // I have no idea how this can happen, but I saw it happen once, in a weird interaction + // involving laptop going to sleep and resuming. + error!("toplevel missing from both unmapped_windows and layout"); + return; + }; + self.niri.layout.remove_window(&window); self.niri.queue_redraw(output); } |
