mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Minor fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
public class NativeMethods
|
public class NativeMethods
|
||||||
{
|
{
|
||||||
@@ -258,24 +259,25 @@ public class NativeMethods
|
|||||||
{
|
{
|
||||||
if ((d.StateFlags & DisplayDeviceStateFlags.AttachedToDesktop) != 0)
|
if ((d.StateFlags & DisplayDeviceStateFlags.AttachedToDesktop) != 0)
|
||||||
{
|
{
|
||||||
|
//Debug.WriteLine(d.DeviceID);
|
||||||
|
//Debug.WriteLine(d.DeviceName);
|
||||||
if (counter == deviceNum)
|
if (counter == deviceNum)
|
||||||
{
|
{
|
||||||
laptopScreen = d.DeviceName;
|
laptopScreen = d.DeviceName;
|
||||||
//Debug.WriteLine(d.DeviceID);
|
|
||||||
//Debug.WriteLine(d.DeviceName);
|
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Mismatch between active screens and enumerated screens, fallback to old method
|
||||||
if (laptopScreen is null)
|
if (counter != activeScreens.Count)
|
||||||
{
|
{
|
||||||
foreach (var screen in screens)
|
laptopScreen = null;
|
||||||
Debug.WriteLine(screen.DeviceName);
|
foreach (var screen in Screen.AllScreens)
|
||||||
|
if (screen.DeviceName == laptopScreenName)
|
||||||
|
laptopScreen = screen.DeviceName;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
return laptopScreen;
|
return laptopScreen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ namespace GHelper
|
|||||||
private static void SetAutoModes()
|
private static void SetAutoModes()
|
||||||
{
|
{
|
||||||
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
|
|
||||||
|
Debug.WriteLine(isPlugged.ToString());
|
||||||
|
|
||||||
settingsForm.AutoGPUMode(isPlugged);
|
settingsForm.AutoGPUMode(isPlugged);
|
||||||
settingsForm.AutoScreen(isPlugged);
|
settingsForm.AutoScreen(isPlugged);
|
||||||
settingsForm.AutoPerformance(isPlugged);
|
settingsForm.AutoPerformance(isPlugged);
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void CheckMatrix_CheckedChanged(object? sender, EventArgs e)
|
private void CheckMatrix_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user