From b16d7abb35ec35dba77de919ef56b9de5c4e9caf Mon Sep 17 00:00:00 2001 From: Christian Meissl Date: Sun, 24 Nov 2024 20:12:39 +0100 Subject: skip keyboard focus for layer shell surfaces not... ...requesting keyboard interactivity --- src/niri.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/niri.rs') 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, + 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, -- cgit