diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-06 16:51:18 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-06 17:34:40 +0300 |
| commit | 3e31c134a602dd876f2b446071e5802fa4a0c3ec (patch) | |
| tree | 0c162b432ee4964e66d24521b3728b447d90afdb /src/handlers | |
| parent | fe682938db2a0aa6e6ffb105a51051a5946a8143 (diff) | |
| download | niri-3e31c134a602dd876f2b446071e5802fa4a0c3ec.tar.gz niri-3e31c134a602dd876f2b446071e5802fa4a0c3ec.tar.bz2 niri-3e31c134a602dd876f2b446071e5802fa4a0c3ec.zip | |
Implement place-within-backdrop layer rule
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/xdg_shell.rs | 15 |
1 files changed, 11 insertions, 4 deletions
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. |
