Bump dependency.

This commit is contained in:
Nolan Darilek 2022-09-21 18:25:52 -05:00
parent 73e6de96ef
commit afcb35661d
2 changed files with 4 additions and 4 deletions

View File

@ -10,4 +10,4 @@ edition = "2021"
bevy = { version = "0.8", default-features = false }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.39", features = ["Win32_System_Power", "Win32_System_Registry", "Win32_System_SystemServices"] }
windows = { version = "0.40", features = ["Win32_System_Power", "Win32_System_Registry", "Win32_System_SystemServices"] }

View File

@ -40,18 +40,18 @@ fn focus_change(
) {
let config: FullThrottleConfig = config
.map(|v| *v)
.unwrap_or_else(|| FullThrottleConfig::default());
.unwrap_or_else(FullThrottleConfig::default);
for event in focus.iter() {
if event.focused {
#[cfg(windows)]
unsafe {
Power::PowerSetActiveScheme(None, &GUID_MIN_POWER_SAVINGS);
Power::PowerSetActiveScheme(None, Some(&GUID_MIN_POWER_SAVINGS));
}
} else {
#[cfg(windows)]
if config.restore_original_scheme_on_unfocus {
unsafe {
Power::PowerSetActiveScheme(None, &**scheme);
Power::PowerSetActiveScheme(None, Some(&**scheme));
}
}
}