From d618daf6b9994f8a0a2ff67531fa3ec72af9a122 Mon Sep 17 00:00:00 2001 From: alex-huff Date: Thu, 22 May 2025 08:18:27 -0500 Subject: layer-shell: don't dismiss popups because of unmapped layer surfaces Fixes #1640 --- src/handlers/xdg_shell.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index bf61e37e..a9eceb67 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -334,9 +334,10 @@ impl XdgShellHandler for State { // higher input priority. if layers.layers_on(Layer::Overlay).any(|l| { - l.cached_state().keyboard_interactivity + (l.cached_state().keyboard_interactivity == wlr_layer::KeyboardInteractivity::Exclusive - || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref()) + && self.niri.mapped_layer_surfaces.contains_key(l) }) { trace!("ignoring toplevel popup grab because the overlay layer has focus"); let _ = PopupManager::dismiss_popup(&root, &popup); @@ -346,9 +347,10 @@ impl XdgShellHandler for State { let mon = self.niri.layout.monitor_for_output(output).unwrap(); if !mon.render_above_top_layer() && layers.layers_on(Layer::Top).any(|l| { - l.cached_state().keyboard_interactivity + (l.cached_state().keyboard_interactivity == wlr_layer::KeyboardInteractivity::Exclusive - || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref()) + && self.niri.mapped_layer_surfaces.contains_key(l) }) { trace!("ignoring toplevel popup grab because the top layer has focus"); -- cgit