From 16405b9b2b99edaf9388df6a7228ca07f110769d Mon Sep 17 00:00:00 2001 From: bbb651 🇮🇱 <53972231+bbb651@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:22:27 +0200 Subject: Implement `niri msg pick-window` * feat: `niri msg pick-window` * fixes --------- Co-authored-by: Ivan Molodetskikh --- src/input/mod.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/input/mod.rs') diff --git a/src/input/mod.rs b/src/input/mod.rs index 51555a96..8e22098c 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -48,6 +48,7 @@ use crate::utils::{center, get_monotonic_time, ResizeEdge}; pub mod backend_ext; pub mod move_grab; +pub mod pick_window_grab; pub mod resize_grab; pub mod scroll_tracker; pub mod spatial_movement_grab; @@ -367,7 +368,6 @@ impl State { serial, time, |this, mods, keysym| { - let bindings = &this.niri.config.borrow().binds; let key_code = event.key_code(); let modified = keysym.modified_sym(); let raw = keysym.raw_latin_sym_or_raw_current_sym(); @@ -383,6 +383,19 @@ impl State { } } + if pressed && raw == Some(Keysym::Escape) && this.niri.pick_window.is_some() { + // We window picking state so the pick window grab must be active. + // Unsetting it cancels window picking. + this.niri + .seat + .get_pointer() + .unwrap() + .unset_grab(this, serial, time); + this.niri.suppressed_keys.insert(key_code); + return FilterResult::Intercept(None); + } + + let bindings = &this.niri.config.borrow().binds; should_intercept_key( &mut this.niri.suppressed_keys, bindings, -- cgit