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 | fe682938db2a0aa6e6ffb105a51051a5946a8143 (patch) | |
| tree | 23808c672f00400e2996377c1d8149749e2572f8 /src | |
| parent | 6142922ca4e96be63a5ec6bcafd6455b6f2e24cc (diff) | |
| download | niri-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.rs | 13 |
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 }) }) }; |
