From f0c291bea440bbb93783ddaff0b283c184a0d39f Mon Sep 17 00:00:00 2001 From: seerge Date: Sun, 12 Mar 2023 16:16:32 +0100 Subject: [PATCH] Minor tweaks --- NativeMethods.cs | 8 ++++++-- Settings.cs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NativeMethods.cs b/NativeMethods.cs index f207b6af..4efb9c5f 100644 --- a/NativeMethods.cs +++ b/NativeMethods.cs @@ -493,14 +493,18 @@ public class NativeMethods if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL) { displayNum = count; - laptopScreen = device.monitorDevicePath; } count++; //Debug.WriteLine(device.outputTechnology); //Debug.WriteLine(device.monitorFriendlyDeviceName); } - + if (Screen.AllScreens.Length != count) + { + Debug.WriteLine("Mismatch between enumerated and available screens"); + return null; + } + count = 0; foreach (var screen in Screen.AllScreens) { diff --git a/Settings.cs b/Settings.cs index 1acdeca6..5dc75a53 100644 --- a/Settings.cs +++ b/Settings.cs @@ -719,7 +719,7 @@ namespace GHelper if (Program.config.getConfigPerf("auto_apply_power") == 1) { - var timer = new System.Timers.Timer(500); + var timer = new System.Timers.Timer(1000); timer.Elapsed += delegate { timer.Stop(); @@ -892,6 +892,7 @@ namespace GHelper Program.settingsForm.BeginInvoke(delegate { InitGPUMode(); + Thread.Sleep(500); AutoScreen(SystemInformation.PowerStatus.PowerLineStatus); }); }).Start();