layer-shell: don't dismiss popups because of unmapped layer surfaces
Browse files at this commitd618daf6b9994f8a0a2ff67531fa3ec72af9a122Parent: 357f9151 changed file +6 -4
src/handlers/xdg_shell.rsmodified+6 -4
| @@ -334,9 +334,10 @@ impl XdgShellHandler for State { | |||
| 334 | // higher input priority. | 334 | // higher input priority. |
| 335 | 335 | ||
| 336 | if layers.layers_on(Layer::Overlay).any(|l| { | 336 | if layers.layers_on(Layer::Overlay).any(|l| { |
| 337 | - l.cached_state().keyboard_interactivity | 337 | + (l.cached_state().keyboard_interactivity |
| 338 | == wlr_layer::KeyboardInteractivity::Exclusive | 338 | == wlr_layer::KeyboardInteractivity::Exclusive |
| 339 | - || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() | 339 | + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref()) |
| 340 | + && self.niri.mapped_layer_surfaces.contains_key(l) | ||
| 340 | }) { | 341 | }) { |
| 341 | trace!("ignoring toplevel popup grab because the overlay layer has focus"); | 342 | trace!("ignoring toplevel popup grab because the overlay layer has focus"); |
| 342 | let _ = PopupManager::dismiss_popup(&root, &popup); | 343 | let _ = PopupManager::dismiss_popup(&root, &popup); |
| @@ -346,9 +347,10 @@ impl XdgShellHandler for State { | |||
| 346 | let mon = self.niri.layout.monitor_for_output(output).unwrap(); | 347 | let mon = self.niri.layout.monitor_for_output(output).unwrap(); |
| 347 | if !mon.render_above_top_layer() | 348 | if !mon.render_above_top_layer() |
| 348 | && layers.layers_on(Layer::Top).any(|l| { | 349 | && layers.layers_on(Layer::Top).any(|l| { |
| 349 | - l.cached_state().keyboard_interactivity | 350 | + (l.cached_state().keyboard_interactivity |
| 350 | == wlr_layer::KeyboardInteractivity::Exclusive | 351 | == wlr_layer::KeyboardInteractivity::Exclusive |
| 351 | - || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() | 352 | + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref()) |
| 353 | + && self.niri.mapped_layer_surfaces.contains_key(l) | ||
| 352 | }) | 354 | }) |
| 353 | { | 355 | { |
| 354 | trace!("ignoring toplevel popup grab because the top layer has focus"); | 356 | trace!("ignoring toplevel popup grab because the top layer has focus"); |