forge
Explore
Log in

Don't you dare go Hollow

Guard against closed screenshot UI in its binds

Browse files at this commit

db1faecc9522dd4751344d3aa4e1d1e987dffc0cIvan MolodetskikhParent: c2c415d
They can trigger with closed screenshot UI via key repeat.
src/input/mod.rsmodified+8 -0
@@ -541,6 +541,10 @@ impl State {
541 }541 }
542 }542 }
543 Action::ConfirmScreenshot => {543 Action::ConfirmScreenshot => {
544+ if !self.niri.screenshot_ui.is_open() {
545+ return;
546+ }
547+
544 self.backend.with_primary_renderer(|renderer| {548 self.backend.with_primary_renderer(|renderer| {
545 match self.niri.screenshot_ui.capture(renderer) {549 match self.niri.screenshot_ui.capture(renderer) {
546 Ok((size, pixels)) => {550 Ok((size, pixels)) => {
@@ -561,6 +565,10 @@ impl State {
561 self.niri.queue_redraw_all();565 self.niri.queue_redraw_all();
562 }566 }
563 Action::CancelScreenshot => {567 Action::CancelScreenshot => {
568+ if !self.niri.screenshot_ui.is_open() {
569+ return;
570+ }
571+
564 self.niri.screenshot_ui.close();572 self.niri.screenshot_ui.close();
565 self.niri573 self.niri
566 .cursor_manager574 .cursor_manager