diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-09 09:18:22 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-09 10:28:20 +0300 |
| commit | 9ff2f83db00aebffb2b7b7fefd23bfd7585926c3 (patch) | |
| tree | 7dbd0ad4505d3e2c76c56a6af0958db34362aa46 /src/input | |
| parent | 7a10f71ee564a7c1054683929f6a0110b0fa3b56 (diff) | |
| download | niri-9ff2f83db00aebffb2b7b7fefd23bfd7585926c3.tar.gz niri-9ff2f83db00aebffb2b7b7fefd23bfd7585926c3.tar.bz2 niri-9ff2f83db00aebffb2b7b7fefd23bfd7585926c3.zip | |
Simplify ScreenshotUi::pointer_button()
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 05880073..f0f601f6 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2563,7 +2563,7 @@ impl State { self.niri.focus_layer_surface_if_on_demand(layer_under); } - if let Some(button) = button { + if button == Some(MouseButton::Left) && self.niri.screenshot_ui.is_open() { let pos = pointer.current_location(); if let Some((output, _)) = self.niri.output_under(pos) { let output = output.clone(); @@ -2578,11 +2578,9 @@ impl State { point.x = min(size.w - 1, point.x); point.y = min(size.h - 1, point.y); - if self - .niri - .screenshot_ui - .pointer_button(output, point, button, button_state) - { + let down = button_state == ButtonState::Pressed; + + if self.niri.screenshot_ui.pointer_button(output, point, down) { self.niri.queue_redraw_all(); } } |
