mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Standard mode fix
This commit is contained in:
@@ -100,6 +100,10 @@ namespace GHelper
|
||||
// Subscribing for system power change events
|
||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
||||
|
||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||
|
||||
clamshellControl.RegisterDisplayEvents();
|
||||
clamshellControl.ToggleLidAction();
|
||||
|
||||
@@ -117,7 +121,19 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
|
||||
{
|
||||
gpuControl.StandardModeFix();
|
||||
}
|
||||
|
||||
private static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
|
||||
{
|
||||
if (e.Reason == SessionSwitchReason.SessionLogon || e.Reason == SessionSwitchReason.SessionUnlock)
|
||||
{
|
||||
Logger.WriteLine("Session:" + e.Reason.ToString());
|
||||
screenControl.AutoScreen();
|
||||
}
|
||||
}
|
||||
|
||||
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
||||
{
|
||||
@@ -178,8 +194,12 @@ namespace GHelper
|
||||
|
||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||
{
|
||||
Logger.WriteLine("Power Mode:" + e.Mode.ToString());
|
||||
|
||||
|
||||
if (e.Mode == PowerModes.Suspend) gpuControl.StandardModeFix();
|
||||
|
||||
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||
Logger.WriteLine("Power Mode Changed");
|
||||
SetAutoModes(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user