aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-05-09 15:42:23 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-09 15:42:23 +0300
commit0763c7e1962bf838ae3bbc65474a829603e3f9f6 (patch)
treef026a3c5235aef08140183b3d4efa72ac0e30e84 /src/input
parentfb5c5204e83f44b1aee20aa9d34bfd2b8a804987 (diff)
downloadniri-0763c7e1962bf838ae3bbc65474a829603e3f9f6.tar.gz
niri-0763c7e1962bf838ae3bbc65474a829603e3f9f6.tar.bz2
niri-0763c7e1962bf838ae3bbc65474a829603e3f9f6.zip
Add a clickable button to capture the screenshot
Allows tablet-, touch- and mouse-only confirmation.
Diffstat (limited to 'src/input')
-rw-r--r--src/input/mod.rs24
1 files changed, 18 insertions, 6 deletions
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();