Merge branch 'fix/anime-flicker' into 'main'

Fix anime flickering when repeatedly setting images in a tight loop

See merge request asus-linux/asusctl!223
This commit is contained in:
fluke
2025-03-27 21:13:25 +00:00

View File

@@ -69,7 +69,11 @@ impl AniMeZbus {
/// it is restarted /// it is restarted
async fn write(&self, input: AnimeDataBuffer) -> zbus::fdo::Result<()> { async fn write(&self, input: AnimeDataBuffer) -> zbus::fdo::Result<()> {
let bright = self.0.config.lock().await.display_brightness; let bright = self.0.config.lock().await.display_brightness;
self.0.set_builtins_enabled(false, bright).await?; if self.0.config.lock().await.builtin_anims_enabled {
// This clears the display, causing flickers if done indiscriminately on every
// write. Therefore, we guard it behind a config check.
self.0.set_builtins_enabled(false, bright).await?;
}
self.0.thread_exit.store(true, Ordering::SeqCst); self.0.thread_exit.store(true, Ordering::SeqCst);
self.0.write_data_buffer(input).await.map_err(|err| { self.0.write_data_buffer(input).await.map_err(|err| {
warn!("ctrl_anime::run_animation:callback {}", err); warn!("ctrl_anime::run_animation:callback {}", err);