Ctrl+Q quits even with close to tray; on Wayland closing quits (no hiding there) until S047
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
387835dd16
commit
021d51ddce
2 changed files with 10 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue