From e30d0ade6ec9f16f48d0540f782846e8a73dad4f Mon Sep 17 00:00:00 2001 From: IndrekV Date: Thu, 26 Oct 2017 07:36:18 +1000 Subject: [PATCH] Fixed app quit issues (win), #2225 --- .../TogglDesktop/TogglDesktop/ui/KeyboardShortcuts.cs | 9 +-------- .../TogglDesktop/ui/windows/MainWindow.xaml.cs | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ui/windows/TogglDesktop/TogglDesktop/ui/KeyboardShortcuts.cs b/src/ui/windows/TogglDesktop/TogglDesktop/ui/KeyboardShortcuts.cs index f0ea546f7b..47f5f01ef3 100644 --- a/src/ui/windows/TogglDesktop/TogglDesktop/ui/KeyboardShortcuts.cs +++ b/src/ui/windows/TogglDesktop/TogglDesktop/ui/KeyboardShortcuts.cs @@ -286,14 +286,7 @@ private static void onLogout(object sender, RoutedEventArgs e) private static void onQuit(object sender, RoutedEventArgs e) { - if (mainWindow.IsVisible) - { - mainWindow.Close(); - } - else - { - Environment.Exit(0); - } + mainWindow.shutdown(0); } #endregion diff --git a/src/ui/windows/TogglDesktop/TogglDesktop/ui/windows/MainWindow.xaml.cs b/src/ui/windows/TogglDesktop/TogglDesktop/ui/windows/MainWindow.xaml.cs index 54c17c5dd2..e944cf323e 100644 --- a/src/ui/windows/TogglDesktop/TogglDesktop/ui/windows/MainWindow.xaml.cs +++ b/src/ui/windows/TogglDesktop/TogglDesktop/ui/windows/MainWindow.xaml.cs @@ -653,7 +653,7 @@ public void ShowOnTop() this.Activate(); } - private void shutdown(int exitCode) + public void shutdown(int exitCode) { if (this.closing) return;