mirror of
https://github.com/storytold/craft-launcher.git
synced 2026-11-02 18:07:04 +00:00
Say once, the first time, that closing the window keeps the launcher in the tray (#376)
The close button parks the launcher in the tray by design, but to someone who doesn't know that, a window that vanishes with nothing to show for it looks hung, and the reports end with killing the process (#45, #215). The first time the window closes to the tray, a system notification says the launcher is still running, that it's in the tray, and that Settings can turn this off. `LauncherUi::hidden_to_tray` sends it through the host and records it in `Settings::tray_hint_shown`, so it happens once per install. The desktop shell calls it from the close-request path only, for both ways of going to the tray; a window hidden from the tray icon, or started hidden at login, gets no hint. Two strings, with rows in all ten complete catalogs. A UI test checks the hint is sent once and recorded. Co-authored-by: YangXZ2008 <141027290+YangXZ2008@users.noreply.github.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>
This commit is contained in:
@@ -790,10 +790,14 @@ impl eframe::App for Shell<'_> {
|
||||
if ctx.input(|i| i.viewport().close_requested()) && !self.quitting && !self.launcher.closed_to_tray {
|
||||
match on_close(self.launcher.tray.is_some(), self.launcher.ui.settings.close_to_tray, self.window_hides) {
|
||||
OnClose::Hide => {
|
||||
self.launcher.ui.hidden_to_tray(&mut self.launcher.host);
|
||||
ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);
|
||||
self.put_away(ctx);
|
||||
}
|
||||
OnClose::ToTray => self.launcher.closed_to_tray = true,
|
||||
OnClose::ToTray => {
|
||||
self.launcher.ui.hidden_to_tray(&mut self.launcher.host);
|
||||
self.launcher.closed_to_tray = true;
|
||||
}
|
||||
OnClose::Quit => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user