diff --git a/crates/app/src/app.rs b/crates/app/src/app.rs index fd280d3..9ea9a95 100644 --- a/crates/app/src/app.rs +++ b/crates/app/src/app.rs @@ -397,7 +397,13 @@ impl App { let on = self.settings.mode == medlar_core::settings::Mode::Snail; self.main.toasts.info("slow_motion_video", if on { tr!("snail.on") } else { tr!("snail.off") }); } - Action::Quit => ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close), + Action::Quit => { + // Quitting closes for real, even with close to tray on. + if let Some(shell) = &mut self.shell { + shell.quitting = true; + } + ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close); + } other => { let anywhere = matches!(other, Action::ResumeAll | Action::PauseAll); if self.screen.is_some() && !anywhere { diff --git a/crates/app/src/shell.rs b/crates/app/src/shell.rs index 2d2a568..7cd75ba 100644 --- a/crates/app/src/shell.rs +++ b/crates/app/src/shell.rs @@ -60,7 +60,9 @@ impl Shell { /// Whether closing the window hides it instead. pub fn hides_on_close(&self, settings: &Settings) -> bool { - !self.quitting && settings.close_to_tray && self.tray.is_some() + // Wayland can't hide a window, so a cancelled close would leave it stuck: close quits there until S047. + let can_hide = std::env::var_os("WAYLAND_DISPLAY").is_none(); + !self.quitting && can_hide && settings.close_to_tray && self.tray.is_some() } /// Once per frame: what was asked comes back, what changed goes out.