From 07bd8bedef325b266920070ef8fee1f6dd4898ed Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Wed, 18 Sep 2024 13:57:10 +0200 Subject: [PATCH] input: Treat pointer-shortcuts as potentially inhibited --- src/input/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/input/mod.rs b/src/input/mod.rs index 3bcb3036..846fae87 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -615,6 +615,16 @@ impl State { }; self.common.idle_notifier_state.notify_activity(&seat); + let current_focus = seat.get_keyboard().unwrap().current_focus(); + let shortcuts_inhibited = current_focus.is_some_and(|f| { + f.wl_surface() + .and_then(|surface| { + seat.keyboard_shortcuts_inhibitor_for_surface(&surface) + .map(|inhibitor| inhibitor.is_active()) + }) + .unwrap_or(false) + }); + let serial = SERIAL_COUNTER.next_serial(); let button = event.button_code(); let mut pass_event = !seat.supressed_buttons().remove(button); @@ -633,7 +643,9 @@ impl State { // Don't check override redirect windows, because we don't set keyboard focus to them explicitly. // These cases are handled by the XwaylandKeyboardGrab. if let Some(target) = shell.element_under(global_position, &output) { - if seat.get_keyboard().unwrap().modifier_state().logo { + if seat.get_keyboard().unwrap().modifier_state().logo + && !shortcuts_inhibited + { if let Some(surface) = target.toplevel().map(Cow::into_owned) { let seat_clone = seat.clone(); let mouse_button = PointerButtonEvent::button(&event);