From 56289abc365b12845bbce92824ec8593371d99ba Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 3 Sep 2023 14:14:54 +0200 Subject: [PATCH] Allow XGM connection from any dGPU mode for models w/o dGPU https://github.com/seerge/g-helper/issues/1235 Hide Backlight OSD if asus OSD is running --- app/Helpers/OptimizationService.cs | 6 ++++++ app/Input/InputDispatcher.cs | 7 +++++-- app/Settings.cs | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/Helpers/OptimizationService.cs b/app/Helpers/OptimizationService.cs index 8559ea80..8ab7b314 100644 --- a/app/Helpers/OptimizationService.cs +++ b/app/Helpers/OptimizationService.cs @@ -55,6 +55,12 @@ namespace GHelper.Helpers return Process.GetProcessesByName("AsusOptimization").Count() > 0; } + public static bool IsOSDRunning() + { + return Process.GetProcessesByName("AsusOSD").Count() > 0; + } + + public static int GetRunningCount() { int count = 0; diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index a6110fe8..71da206a 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -624,8 +624,11 @@ namespace GHelper.Input AsusUSB.ApplyBrightness(backlight, "HotKey"); } - string[] backlightNames = new string[] { "Off", "Low", "Mid", "Max" }; - Program.toast.RunToast(backlightNames[backlight], delta > 0 ? ToastIcon.BacklightUp : ToastIcon.BacklightDown); + if (!OptimizationService.IsOSDRunning()) + { + string[] backlightNames = new string[] { "Off", "Low", "Mid", "Max" }; + Program.toast.RunToast(backlightNames[backlight], delta > 0 ? ToastIcon.BacklightUp : ToastIcon.BacklightDown); + } } diff --git a/app/Settings.cs b/app/Settings.cs index 416e2e2f..3024602c 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -1057,7 +1057,6 @@ namespace GHelper buttonOptimized.Activated = GPUAuto; labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco; Program.trayIcon.Icon = Properties.Resources.eco; - ButtonEnabled(buttonXGM, false); break; case AsusACPI.GPUModeUltimate: buttonUltimate.Activated = true; @@ -1070,10 +1069,11 @@ namespace GHelper buttonOptimized.Activated = GPUAuto; labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard; Program.trayIcon.Icon = Properties.Resources.standard; - ButtonEnabled(buttonXGM, true); break; } + ButtonEnabled(buttonXGM, AppConfig.ContainsModel("GV301RA") || GPUMode != AsusACPI.GPUModeEco); + if (isGpuSection) { menuEco.Checked = buttonEco.Activated;