diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-25 08:43:37 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-25 08:43:37 +0400 |
| commit | 04c5b9ad7489bfa6cbc7c109eb449fb81e0b4d5a (patch) | |
| tree | e4331bfcad8bf2c126bfdbc02aecd116d7fd8d18 /src/handlers | |
| parent | fd6c8c7790ae4e7dca1f242263f41411a1bab96e (diff) | |
| download | niri-04c5b9ad7489bfa6cbc7c109eb449fb81e0b4d5a.tar.gz niri-04c5b9ad7489bfa6cbc7c109eb449fb81e0b4d5a.tar.bz2 niri-04c5b9ad7489bfa6cbc7c109eb449fb81e0b4d5a.zip | |
Only give keyboard focus to exclusive layer-shell surfaces
Workaround until we properly support on-demand.
See: https://github.com/YaLTeR/niri/issues/308
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/xdg_shell.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 0b0a5a33..6f627850 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -18,7 +18,7 @@ use smithay::wayland::compositor::{ }; use smithay::wayland::input_method::InputMethodSeat; use smithay::wayland::shell::kde::decoration::{KdeDecorationHandler, KdeDecorationState}; -use smithay::wayland::shell::wlr_layer::Layer; +use smithay::wayland::shell::wlr_layer::{self, Layer}; use smithay::wayland::shell::xdg::decoration::XdgDecorationHandler; use smithay::wayland::shell::xdg::{ PopupSurface, PositionerState, ToplevelSurface, XdgPopupSurfaceData, XdgShellHandler, @@ -121,19 +121,20 @@ impl XdgShellHandler for State { return; } } else { - if layers - .layers_on(Layer::Overlay) - .any(|l| l.can_receive_keyboard_focus()) - { + if layers.layers_on(Layer::Overlay).any(|l| { + l.cached_state().keyboard_interactivity + == wlr_layer::KeyboardInteractivity::Exclusive + }) { let _ = PopupManager::dismiss_popup(&root, &popup); return; } let mon = self.niri.layout.monitor_for_output(output).unwrap(); if !mon.render_above_top_layer() - && layers - .layers_on(Layer::Top) - .any(|l| l.can_receive_keyboard_focus()) + && layers.layers_on(Layer::Top).any(|l| { + l.cached_state().keyboard_interactivity + == wlr_layer::KeyboardInteractivity::Exclusive + }) { let _ = PopupManager::dismiss_popup(&root, &popup); return; |
