diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index ae629874..72074db4 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -37,7 +37,7 @@ public AniMatrixControl(SettingsForm settingsForm) { settings = settingsForm; if (!AppConfig.IsSlash() && !AppConfig.IsAnimeMatrix()) return; - + try { if (AppConfig.IsSlash()) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index 19aa6a6f..94e0b868 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -517,6 +517,11 @@ public static bool IsNoDirectRGB() return ContainsModel("GA503") || ContainsModel("G533Q") || ContainsModel("GU502") || ContainsModel("GU603") || IsSlash(); } + public static bool NoGpu() + { + return Is("no_gpu"); + } + public static bool IsStrixNumpad() { return ContainsModel("G713R"); diff --git a/app/Gpu/AMD/AmdGpuControl.cs b/app/Gpu/AMD/AmdGpuControl.cs index 3f774203..29964184 100644 --- a/app/Gpu/AMD/AmdGpuControl.cs +++ b/app/Gpu/AMD/AmdGpuControl.cs @@ -62,7 +62,7 @@ public class AmdGpuControl : IGpuControl public AmdGpuControl() { - if (!Adl2.Load()) + if (!Adl2.Load() || AppConfig.NoGpu()) return; try diff --git a/app/Gpu/GPUModeControl.cs b/app/Gpu/GPUModeControl.cs index 07b95560..cb95c9e6 100644 --- a/app/Gpu/GPUModeControl.cs +++ b/app/Gpu/GPUModeControl.cs @@ -44,7 +44,7 @@ public void InitGPUMode() // GPU mode not supported if (eco < 0 && mux < 0) { - if (gpuExists is null) gpuExists = Program.acpi.GetFan(AsusFan.GPU) >= 0; + if (gpuExists is null) gpuExists = (!AppConfig.NoGpu()) && Program.acpi.GetFan(AsusFan.GPU) >= 0; settings.HideGPUModes((bool)gpuExists); } } diff --git a/app/HardwareControl.cs b/app/HardwareControl.cs index 6d1281e6..465fac45 100644 --- a/app/HardwareControl.cs +++ b/app/HardwareControl.cs @@ -289,26 +289,29 @@ public static void RecreateGpuControl() { GpuControl?.Dispose(); - IGpuControl _gpuControl = new NvidiaGpuControl(); - - if (_gpuControl.IsValid) + if (!AppConfig.NoGpu()) { - GpuControl = _gpuControl; - Logger.WriteLine(GpuControl.FullName); - return; - } + IGpuControl _gpuControl = new NvidiaGpuControl(); - _gpuControl.Dispose(); + if (_gpuControl.IsValid) + { + GpuControl = _gpuControl; + Logger.WriteLine(GpuControl.FullName); + return; + } - _gpuControl = new AmdGpuControl(); - if (_gpuControl.IsValid) - { - GpuControl = _gpuControl; - if (GpuControl.FullName.Contains("6850M")) AppConfig.Set("xgm_special", 1); - Logger.WriteLine(GpuControl.FullName); - return; - } - _gpuControl.Dispose(); + _gpuControl.Dispose(); + + _gpuControl = new AmdGpuControl(); + if (_gpuControl.IsValid) + { + GpuControl = _gpuControl; + if (GpuControl.FullName.Contains("6850M")) AppConfig.Set("xgm_special", 1); + Logger.WriteLine(GpuControl.FullName); + return; + } + _gpuControl.Dispose(); + } Logger.WriteLine("dGPU not found"); GpuControl = null; diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 79cc0736..107ce494 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -481,9 +481,8 @@ public bool IsDeviceConnected() { try { - HidSharp.DeviceList.Local.GetHidDevices(VendorID(), ProductID()) - .First(x => x.DevicePath.Contains(path)); - return true; + return HidSharp.DeviceList.Local.GetHidDevices(VendorID(), ProductID()) + .FirstOrDefault(x => x.DevicePath.Contains(path)) != null; } catch {