mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
input: Suppress release from Pick grab clicks
Otherwise, it would trigger something inside the window.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user