Browse Source

'Close to Tray' from tray context menu works even if settings say not to close to tray

Antony Male 10 years ago
parent
commit
3bbccb2b0a
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/SyncTrayzor/NotifyIcon/NotifyIconManager.cs

+ 6 - 1
src/SyncTrayzor/NotifyIcon/NotifyIconManager.cs

@@ -76,7 +76,12 @@ namespace SyncTrayzor.NotifyIcon
             {
                 this.rootViewModel.EnsureInForeground();
             };
-            this.viewModel.WindowCloseRequested += (o, e) => this.rootViewModel.CloseToTray();
+            this.viewModel.WindowCloseRequested += (o, e) =>
+            {
+                // Always minimize, regardless of settings
+                this.application.ShutdownMode = ShutdownMode.OnExplicitShutdown;
+                this.rootViewModel.CloseToTray();
+            };
             this.viewModel.ExitRequested += (o, e) => this.rootViewModel.Shutdown();
 
             this.syncThingManager.FolderSyncStateChanged += (o, e) =>