input: Suppress release from Pick grab clicks

Otherwise, it would trigger something inside the window.
This commit is contained in:
Ivan Molodetskikh
2025-03-23 09:00:23 +03:00
parent 7210045b2a
commit 500dcca9b7
2 changed files with 18 additions and 9 deletions
+3
View File
@@ -120,6 +120,9 @@ impl PointerGrab<State> for PickColorGrab {
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_color.take() {
let color = Self::pick_color_at_point(handle.current_location(), data);
let _ = tx.send_blocking(color);
+15 -9
View File
@@ -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(