diff options
| author | bbb651 🇮🇱 <53972231+bbb651@users.noreply.github.com> | 2025-02-26 14:22:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-26 15:22:27 +0300 |
| commit | 16405b9b2b99edaf9388df6a7228ca07f110769d (patch) | |
| tree | d05734655900336c809bb212230cb4d34a6325b2 /src/input/mod.rs | |
| parent | 4719cc6d5942c70f43ae167d66d2383708ae3536 (diff) | |
| download | niri-16405b9b2b99edaf9388df6a7228ca07f110769d.tar.gz niri-16405b9b2b99edaf9388df6a7228ca07f110769d.tar.bz2 niri-16405b9b2b99edaf9388df6a7228ca07f110769d.zip | |
Implement `niri msg pick-window`
* feat: `niri msg pick-window`
* fixes
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src/input/mod.rs')
| -rw-r--r-- | src/input/mod.rs | 15 |
1 files changed, 14 insertions, 1 deletions
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, |
