From 0763c7e1962bf838ae3bbc65474a829603e3f9f6 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 9 May 2025 15:42:23 +0300 Subject: Add a clickable button to capture the screenshot Allows tablet-, touch- and mouse-only confirmation. --- src/input/mod.rs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/input/mod.rs') diff --git a/src/input/mod.rs b/src/input/mod.rs index a23c2e13..1f790f16 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2561,8 +2561,12 @@ impl State { self.niri.queue_redraw_all(); } } - } else if self.niri.screenshot_ui.pointer_up(None) { - self.niri.queue_redraw_all(); + } else if let Some(capture) = self.niri.screenshot_ui.pointer_up(None) { + if capture { + self.confirm_screenshot(true); + } else { + self.niri.queue_redraw_all(); + } } } @@ -3129,8 +3133,12 @@ impl State { } } TabletToolTipState::Up => { - if self.niri.screenshot_ui.pointer_up(None) { - self.niri.queue_redraw_all(); + if let Some(capture) = self.niri.screenshot_ui.pointer_up(None) { + if capture { + self.confirm_screenshot(true); + } else { + self.niri.queue_redraw_all(); + } } tool.tip_up(event.time_msec()); @@ -3639,8 +3647,12 @@ impl State { }; let slot = evt.slot(); - if self.niri.screenshot_ui.pointer_up(Some(slot)) { - self.niri.queue_redraw_all(); + if let Some(capture) = self.niri.screenshot_ui.pointer_up(Some(slot)) { + if capture { + self.confirm_screenshot(true); + } else { + self.niri.queue_redraw_all(); + } } let serial = SERIAL_COUNTER.next_serial(); -- cgit