From fe682938db2a0aa6e6ffb105a51051a5946a8143 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 6 May 2025 16:51:18 +0300 Subject: Simplify exclusive focus on layer check --- src/niri.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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 }) }) }; -- cgit