aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-05-06 16:51:18 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-06 17:34:40 +0300
commitfe682938db2a0aa6e6ffb105a51051a5946a8143 (patch)
tree23808c672f00400e2996377c1d8149749e2572f8 /src
parent6142922ca4e96be63a5ec6bcafd6455b6f2e24cc (diff)
downloadniri-fe682938db2a0aa6e6ffb105a51051a5946a8143.tar.gz
niri-fe682938db2a0aa6e6ffb105a51051a5946a8143.tar.bz2
niri-fe682938db2a0aa6e6ffb105a51051a5946a8143.zip
Simplify exclusive focus on layer check
Diffstat (limited to 'src')
-rw-r--r--src/niri.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 9b195a1e..be553293 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -1036,11 +1036,14 @@ impl State {
let excl_focus_on_layer = |layer| {
layers.layers_on(layer).find_map(|surface| {
- let can_receive_exclusive_focus = surface.cached_state().keyboard_interactivity
- == wlr_layer::KeyboardInteractivity::Exclusive;
- can_receive_exclusive_focus
- .then(|| surface.wl_surface().clone())
- .map(|surface| KeyboardFocus::LayerShell { surface })
+ if surface.cached_state().keyboard_interactivity
+ != wlr_layer::KeyboardInteractivity::Exclusive
+ {
+ return None;
+ }
+
+ let surface = surface.wl_surface().clone();
+ Some(KeyboardFocus::LayerShell { surface })
})
};