Only touch power settings if the user checks the box. But always disable the changes back to the defaults when the user unchecks it.

This commit is contained in:
IceStormNG
2023-07-21 15:38:26 +02:00
parent afe760f58d
commit 25f842df9d
2 changed files with 29 additions and 6 deletions

View File

@@ -46,17 +46,31 @@ namespace GHelper.Helpers
public void ToggleLidAction()
{
if (IsInClamshellMode() && IsClamshellEnabled())
if (!IsClamshellEnabled())
{
PowerNative.SetLidAction(0, true);
Logger.WriteLine("Engaging Clamshell Mode");
return;
}
if (IsInClamshellMode())
{
EnableClamshellMode();
}
else
{
PowerNative.SetLidAction(1, true);
Logger.WriteLine("Disengaging Clamshell Mode");
DisableClamshellMode();
}
}
public static void DisableClamshellMode()
{
PowerNative.SetLidAction(1, true);
Logger.WriteLine("Disengaging Clamshell Mode");
}
public static void EnableClamshellMode()
{
PowerNative.SetLidAction(0, true);
Logger.WriteLine("Engaging Clamshell Mode");
}
public void UnregisterDisplayEvents()
{