diff options
| author | Christian Meissl <meissl.christian@gmail.com> | 2024-11-24 20:12:39 +0100 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-02 14:24:39 +0300 |
| commit | b16d7abb35ec35dba77de919ef56b9de5c4e9caf (patch) | |
| tree | 64b311da5191c2cb88a83e234780b0fe044ed976 /src/niri.rs | |
| parent | 2f17a30157614cb0222ada09e5d7b64fd4591f45 (diff) | |
| download | niri-b16d7abb35ec35dba77de919ef56b9de5c4e9caf.tar.gz niri-b16d7abb35ec35dba77de919ef56b9de5c4e9caf.tar.bz2 niri-b16d7abb35ec35dba77de919ef56b9de5c4e9caf.zip | |
skip keyboard focus for layer shell surfaces not...
...requesting keyboard interactivity
Diffstat (limited to 'src/niri.rs')
| -rw-r--r-- | src/niri.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs index 2c5cbe48..7d81bbc6 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -409,6 +409,7 @@ pub enum RedrawState { pub struct PopupGrabState { pub root: WlSurface, pub grab: PopupGrab<State>, + pub has_keyboard_grab: bool, } // The surfaces here are always toplevel surfaces focused as far as niri's logic is concerned, even @@ -865,7 +866,7 @@ impl State { let layer_grab = self.niri.popup_grab.as_ref().and_then(|g| { layers .layer_for_surface(&g.root, WindowSurfaceType::TOPLEVEL) - .map(|l| (&g.root, l.layer())) + .and_then(|l| l.can_receive_keyboard_focus().then(|| (&g.root, l.layer()))) }); let grab_on_layer = |layer: Layer| { layer_grab @@ -984,7 +985,7 @@ impl State { } if let Some(grab) = self.niri.popup_grab.as_mut() { - if Some(&grab.root) != focus.surface() { + if grab.has_keyboard_grab && Some(&grab.root) != focus.surface() { trace!( "grab root {:?} is not the new focus {:?}, ungrabbing", grab.root, |
