aboutsummaryrefslogtreecommitdiff
path: root/src/input/mod.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-05-09 15:41:57 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-09 15:41:57 +0300
commitfb5c5204e83f44b1aee20aa9d34bfd2b8a804987 (patch)
tree18603bd41afb548696ef0804c2ef1d8bb9fd7890 /src/input/mod.rs
parentd207cd385b12e9c6b52e3865c74af5ec5c042552 (diff)
downloadniri-fb5c5204e83f44b1aee20aa9d34bfd2b8a804987.tar.gz
niri-fb5c5204e83f44b1aee20aa9d34bfd2b8a804987.tar.bz2
niri-fb5c5204e83f44b1aee20aa9d34bfd2b8a804987.zip
Extract confirm_screenshot()
Diffstat (limited to 'src/input/mod.rs')
-rw-r--r--src/input/mod.rs24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs
index 2fd5ab55..a23c2e13 100644
--- a/src/input/mod.rs
+++ b/src/input/mod.rs
@@ -593,29 +593,7 @@ impl State {
}
}
Action::ConfirmScreenshot { write_to_disk } => {
- if !self.niri.screenshot_ui.is_open() {
- return;
- }
-
- self.backend.with_primary_renderer(|renderer| {
- match self.niri.screenshot_ui.capture(renderer) {
- Ok((size, pixels)) => {
- if let Err(err) = self.niri.save_screenshot(size, pixels, write_to_disk)
- {
- warn!("error saving screenshot: {err:?}");
- }
- }
- Err(err) => {
- warn!("error capturing screenshot: {err:?}");
- }
- }
- });
-
- self.niri.screenshot_ui.close();
- self.niri
- .cursor_manager
- .set_cursor_image(CursorImageStatus::default_named());
- self.niri.queue_redraw_all();
+ self.confirm_screenshot(write_to_disk);
}
Action::CancelScreenshot => {
if !self.niri.screenshot_ui.is_open() {