Skip to content

Commit 07bd8be

Browse files
committed
input: Treat pointer-shortcuts as potentially inhibited
1 parent 15a6425 commit 07bd8be

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/input/mod.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,16 @@ impl State {
615615
};
616616
self.common.idle_notifier_state.notify_activity(&seat);
617617

618+
let current_focus = seat.get_keyboard().unwrap().current_focus();
619+
let shortcuts_inhibited = current_focus.is_some_and(|f| {
620+
f.wl_surface()
621+
.and_then(|surface| {
622+
seat.keyboard_shortcuts_inhibitor_for_surface(&surface)
623+
.map(|inhibitor| inhibitor.is_active())
624+
})
625+
.unwrap_or(false)
626+
});
627+
618628
let serial = SERIAL_COUNTER.next_serial();
619629
let button = event.button_code();
620630
let mut pass_event = !seat.supressed_buttons().remove(button);
@@ -633,7 +643,9 @@ impl State {
633643
// Don't check override redirect windows, because we don't set keyboard focus to them explicitly.
634644
// These cases are handled by the XwaylandKeyboardGrab.
635645
if let Some(target) = shell.element_under(global_position, &output) {
636-
if seat.get_keyboard().unwrap().modifier_state().logo {
646+
if seat.get_keyboard().unwrap().modifier_state().logo
647+
&& !shortcuts_inhibited
648+
{
637649
if let Some(surface) = target.toplevel().map(Cow::into_owned) {
638650
let seat_clone = seat.clone();
639651
let mouse_button = PointerButtonEvent::button(&event);

0 commit comments

Comments
 (0)