Skip to content

Commit

Permalink
Only cancel the keyboard grabs that we initiate
Browse files Browse the repository at this point in the history
  • Loading branch information
jneem authored and Drakulix committed Jan 17, 2025
1 parent 53d2cf0 commit 3836670
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
grabs::{ReleaseMode, ResizeEdge},
layout::{
floating::ResizeGrabMarker,
tiling::{NodeDesc, TilingLayout},
tiling::{NodeDesc, SwapWindowGrab, TilingLayout},
},
SeatExt, Trigger,
},
Expand All @@ -44,7 +44,7 @@ use smithay::{
TabletToolButtonEvent, TabletToolEvent, TabletToolProximityEvent, TabletToolTipEvent,
TabletToolTipState, TouchEvent,
},
desktop::{utils::under_from_surface_tree, WindowSurfaceType},
desktop::{utils::under_from_surface_tree, PopupKeyboardGrab, WindowSurfaceType},
input::{
keyboard::{FilterResult, KeysymHandle, ModifiersState},
pointer::{
Expand Down Expand Up @@ -1428,7 +1428,12 @@ impl State {

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

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

0 comments on commit 3836670

Please sign in to comment.