mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fix to suspend process in anime thread to let custom anims run on wake
This commit is contained in:
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Changed
|
||||||
|
- Fix to suspend process in anime thread to let custom anims run on wake
|
||||||
|
|
||||||
## [v5.0.6]
|
## [v5.0.6]
|
||||||
- Revert egui update due to a lot of issues arising from window closing.
|
- Revert egui update due to a lot of issues arising from window closing.
|
||||||
|
|||||||
@@ -277,16 +277,8 @@ impl crate::CtrlTask for CtrlAnimeZbus {
|
|||||||
async move {
|
async move {
|
||||||
let lock = inner.lock().await;
|
let lock = inner.lock().await;
|
||||||
if lock.config.display_enabled {
|
if lock.config.display_enabled {
|
||||||
lock.node
|
|
||||||
.write_bytes(&pkt_set_enable_powersave_anim(
|
|
||||||
!(sleeping && lock.config.off_when_suspended),
|
|
||||||
))
|
|
||||||
.map_err(|err| {
|
|
||||||
warn!("create_sys_event_tasks::off_when_suspended {}", err);
|
|
||||||
})
|
|
||||||
.ok();
|
|
||||||
|
|
||||||
lock.thread_exit.store(true, Ordering::Release); // ensure clean slate
|
lock.thread_exit.store(true, Ordering::Release); // ensure clean slate
|
||||||
|
|
||||||
lock.node
|
lock.node
|
||||||
.write_bytes(&pkt_set_enable_display(
|
.write_bytes(&pkt_set_enable_display(
|
||||||
!(sleeping && lock.config.off_when_suspended),
|
!(sleeping && lock.config.off_when_suspended),
|
||||||
@@ -296,7 +288,21 @@ impl crate::CtrlTask for CtrlAnimeZbus {
|
|||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
if !sleeping && !lock.config.builtin_anims_enabled {
|
if lock.config.builtin_anims_enabled {
|
||||||
|
lock.node
|
||||||
|
.write_bytes(&pkt_set_enable_powersave_anim(
|
||||||
|
!(sleeping && lock.config.off_when_suspended),
|
||||||
|
))
|
||||||
|
.map_err(|err| {
|
||||||
|
warn!("create_sys_event_tasks::off_when_suspended {}", err);
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
} else if !sleeping && !lock.config.builtin_anims_enabled {
|
||||||
|
// Run custom wake animation
|
||||||
|
lock.node
|
||||||
|
.write_bytes(&pkt_set_enable_powersave_anim(false))
|
||||||
|
.ok(); // ensure builtins are disabled
|
||||||
|
|
||||||
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
|
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user