Minor tweaks

This commit is contained in:
seerge
2023-03-12 16:16:32 +01:00
parent 4875a22f38
commit f0c291bea4
2 changed files with 8 additions and 3 deletions

View File

@@ -493,14 +493,18 @@ public class NativeMethods
if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL) if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL)
{ {
displayNum = count; displayNum = count;
laptopScreen = device.monitorDevicePath;
} }
count++; count++;
//Debug.WriteLine(device.outputTechnology); //Debug.WriteLine(device.outputTechnology);
//Debug.WriteLine(device.monitorFriendlyDeviceName); //Debug.WriteLine(device.monitorFriendlyDeviceName);
} }
if (Screen.AllScreens.Length != count)
{
Debug.WriteLine("Mismatch between enumerated and available screens");
return null;
}
count = 0; count = 0;
foreach (var screen in Screen.AllScreens) foreach (var screen in Screen.AllScreens)
{ {

View File

@@ -719,7 +719,7 @@ namespace GHelper
if (Program.config.getConfigPerf("auto_apply_power") == 1) 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.Elapsed += delegate
{ {
timer.Stop(); timer.Stop();
@@ -892,6 +892,7 @@ namespace GHelper
Program.settingsForm.BeginInvoke(delegate Program.settingsForm.BeginInvoke(delegate
{ {
InitGPUMode(); InitGPUMode();
Thread.Sleep(500);
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus); AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
}); });
}).Start(); }).Start();