mirror of
https://github.com/lightsoutgames/bevy_full_throttle
synced 2024-12-22 09:05:56 +00:00
Bump dependency.
This commit is contained in:
parent
73e6de96ef
commit
afcb35661d
|
@ -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"] }
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user