From a30920ed70b7773c2d1fd9aaadcb68fecb0e3e9d Mon Sep 17 00:00:00 2001 From: nopeless <38830903+nopeless@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:09:52 -0500 Subject: [PATCH] fix: respect tray icon behavior --- app/Input/InputDispatcher.cs | 4 ++-- app/Program.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 8565cb34..0cc17d66 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -337,7 +337,7 @@ namespace GHelper.Input if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift)) { if (e.Key == keyProfile) modeControl.CyclePerformanceMode(); - if (e.Key == keyApp) Program.SettingsToggle(); + if (e.Key == keyApp) Program.SettingsToggle("", true); if (e.Key == Keys.F20) KeyProcess("m3"); } @@ -427,7 +427,7 @@ namespace GHelper.Input { Program.settingsForm.BeginInvoke(delegate { - Program.SettingsToggle(); + Program.SettingsToggle("", true); }); } catch (Exception ex) diff --git a/app/Program.cs b/app/Program.cs index 88948c83..390c568c 100644 --- a/app/Program.cs +++ b/app/Program.cs @@ -213,13 +213,13 @@ namespace GHelper SetAutoModes(true); } - public static void SettingsToggle(string action = "") + public static void SettingsToggle(string action = "", bool checkForFocus = false) { if (settingsForm.Visible) { // If helper window is not on top, this just focuses on the app again // Pressing the ghelper button again will hide the app - if (!settingsForm.HasAnyFocus()) + if (checkForFocus && !settingsForm.HasAnyFocus()) { settingsForm.ShowAll(); }