Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't cancel grabs on Escape. #1126

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading