Skip to content

Commit 3836670

Browse files
jneemDrakulix
authored andcommitted
Only cancel the keyboard grabs that we initiate
1 parent 53d2cf0 commit 3836670

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/input/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
grabs::{ReleaseMode, ResizeEdge},
2020
layout::{
2121
floating::ResizeGrabMarker,
22-
tiling::{NodeDesc, TilingLayout},
22+
tiling::{NodeDesc, SwapWindowGrab, TilingLayout},
2323
},
2424
SeatExt, Trigger,
2525
},
@@ -44,7 +44,7 @@ use smithay::{
4444
TabletToolButtonEvent, TabletToolEvent, TabletToolProximityEvent, TabletToolTipEvent,
4545
TabletToolTipState, TouchEvent,
4646
},
47-
desktop::{utils::under_from_surface_tree, WindowSurfaceType},
47+
desktop::{utils::under_from_surface_tree, PopupKeyboardGrab, WindowSurfaceType},
4848
input::{
4949
keyboard::{FilterResult, KeysymHandle, ModifiersState},
5050
pointer::{
@@ -1428,7 +1428,12 @@ impl State {
14281428

14291429
let keyboard = seat.get_keyboard().unwrap();
14301430
let pointer = seat.get_pointer().unwrap();
1431-
let is_grabbed = keyboard.is_grabbed() || pointer.is_grabbed();
1431+
// We're only interested in filtering keyboard grabs if we initiated them.
1432+
// The easiest way to check that is to check the type of the grab.
1433+
let keyboard_grabbed = keyboard.with_grab(|_serial, grab| {
1434+
grab.is::<SwapWindowGrab>() || grab.is::<PopupKeyboardGrab<State>>()
1435+
}) == Some(true);
1436+
let is_grabbed = keyboard_grabbed || pointer.is_grabbed();
14321437

14331438
let current_focus = keyboard.current_focus();
14341439
//this should fall back to active output since there may not be a focused output

0 commit comments

Comments
 (0)