Simplify exclusive focus on layer check
Browse files at this commitfe682938db2a0aa6e6ffb105a51051a5946a8143Parent: 61429221 changed file +8 -5
- src/niri.rs +8 -5
src/niri.rsmodified+8 -5
| @@ -1036,11 +1036,14 @@ impl State { | |||
| 1036 | 1036 | ||
| 1037 | let excl_focus_on_layer = |layer| { | 1037 | let excl_focus_on_layer = |layer| { |
| 1038 | layers.layers_on(layer).find_map(|surface| { | 1038 | layers.layers_on(layer).find_map(|surface| { |
| 1039 | - let can_receive_exclusive_focus = surface.cached_state().keyboard_interactivity | 1039 | + if surface.cached_state().keyboard_interactivity |
| 1040 | - == wlr_layer::KeyboardInteractivity::Exclusive; | 1040 | + != wlr_layer::KeyboardInteractivity::Exclusive |
| 1041 | - can_receive_exclusive_focus | 1041 | + { |
| 1042 | - .then(|| surface.wl_surface().clone()) | 1042 | + return None; |
| 1043 | - .map(|surface| KeyboardFocus::LayerShell { surface }) | 1043 | + } |
| 1044 | + | ||
| 1045 | + let surface = surface.wl_surface().clone(); | ||
| 1046 | + Some(KeyboardFocus::LayerShell { surface }) | ||
| 1044 | }) | 1047 | }) |
| 1045 | }; | 1048 | }; |
| 1046 | 1049 | ||