aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-04-25 08:43:37 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-04-25 08:43:37 +0400
commit04c5b9ad7489bfa6cbc7c109eb449fb81e0b4d5a (patch)
treee4331bfcad8bf2c126bfdbc02aecd116d7fd8d18 /src/niri.rs
parentfd6c8c7790ae4e7dca1f242263f41411a1bab96e (diff)
downloadniri-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/niri.rs')
-rw-r--r--src/niri.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 10fc31a7..4baff6f0 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -78,7 +78,7 @@ use smithay::wayland::selection::primary_selection::PrimarySelectionState;
use smithay::wayland::selection::wlr_data_control::DataControlState;
use smithay::wayland::session_lock::{LockSurface, SessionLockManagerState, SessionLocker};
use smithay::wayland::shell::kde::decoration::KdeDecorationState;
-use smithay::wayland::shell::wlr_layer::{Layer, WlrLayerShellState};
+use smithay::wayland::shell::wlr_layer::{self, Layer, WlrLayerShellState};
use smithay::wayland::shell::xdg::decoration::XdgDecorationState;
use smithay::wayland::shell::xdg::XdgShellState;
use smithay::wayland::shm::ShmState;
@@ -702,8 +702,9 @@ impl State {
})
};
let layer_focus = |surface: &LayerSurface| {
- surface
- .can_receive_keyboard_focus()
+ let can_receive_keyboard_focus = surface.cached_state().keyboard_interactivity
+ == wlr_layer::KeyboardInteractivity::Exclusive;
+ can_receive_keyboard_focus
.then(|| surface.wl_surface().clone())
.map(|surface| KeyboardFocus::LayerShell { surface })
};