From 3e31c134a602dd876f2b446071e5802fa4a0c3ec Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 6 May 2025 16:51:18 +0300 Subject: Implement place-within-backdrop layer rule --- src/handlers/xdg_shell.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/handlers') diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 4dfce86d..bf61e37e 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -319,10 +319,17 @@ impl XdgShellHandler for State { // FIXME: somewhere here we probably need to check is_overview_open to match the logic // in update_keyboard_focus(). - if layers - .layer_for_surface(&root, WindowSurfaceType::TOPLEVEL) - .is_none() - { + if let Some(layer) = layers.layer_for_surface(&root, WindowSurfaceType::TOPLEVEL) { + // This is a grab for a layer surface. + + if let Some(mapped) = self.niri.mapped_layer_surfaces.get(layer) { + if mapped.place_within_backdrop() { + trace!("ignoring popup grab for a layer surface within overview backdrop"); + let _ = PopupManager::dismiss_popup(&root, &popup); + return; + } + } + } else { // This is a grab for a regular window; check that there's no layer surface with a // higher input priority. -- cgit