mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-06 06:43:49 +00:00
Restore fan mode on resume
This commit is contained in:
parent
75f40c4167
commit
def9012056
3 changed files with 22 additions and 0 deletions
|
|
@ -50,6 +50,23 @@ namespace FanControl
|
|||
}
|
||||
|
||||
notifyIcon.ShowBalloonTip(3000, Text, "Fan Control Started", ToolTipIcon.Info);
|
||||
|
||||
Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
}
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
Microsoft.Win32.SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
||||
}
|
||||
|
||||
private void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e)
|
||||
{
|
||||
// Restore fan mode on resume
|
||||
if (e.Mode == Microsoft.Win32.PowerModes.Resume)
|
||||
{
|
||||
fanControl.SetMode(fanControl.Mode);
|
||||
}
|
||||
}
|
||||
|
||||
private void setFanMode(FanController.FanMode mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue