diff options
Diffstat (limited to 'src/input/pick_window_grab.rs')
| -rw-r--r-- | src/input/pick_window_grab.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/input/pick_window_grab.rs b/src/input/pick_window_grab.rs index 9a3b22ae..9c2615b4 100644 --- a/src/input/pick_window_grab.rs +++ b/src/input/pick_window_grab.rs @@ -60,16 +60,22 @@ impl PointerGrab<State> for PickWindowGrab { handle: &mut PointerInnerHandle<'_, State>, event: &ButtonEvent, ) { - if event.state == ButtonState::Pressed { - if let Some(tx) = data.niri.pick_window.take() { - let _ = tx.send_blocking( - data.niri - .window_under(handle.current_location()) - .map(Mapped::id), - ); - } - handle.unset_grab(self, data, event.serial, event.time, true); + if event.state != ButtonState::Pressed { + return; } + + // We're handling this press, don't send the release to the window. + data.niri.suppressed_buttons.insert(event.button); + + if let Some(tx) = data.niri.pick_window.take() { + let _ = tx.send_blocking( + data.niri + .window_under(handle.current_location()) + .map(Mapped::id), + ); + } + + handle.unset_grab(self, data, event.serial, event.time, true); } fn axis( |
