From 69401d01b3aa27530319e5b530b1c4af85ba8791 Mon Sep 17 00:00:00 2001 From: Nicolas Craig Rossi <35790619+nicolascrossi@users.noreply.github.com> Date: Sat, 3 Oct 2026 09:18:53 -0700 Subject: [PATCH] fix: correctly wake Stream Deck + after system resume (#420) --- src-tauri/src/elgato.rs | 10 ++++++++++ src-tauri/src/power_events.rs | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src-tauri/src/elgato.rs b/src-tauri/src/elgato.rs index 24d2c60..dcd6952 100644 --- a/src-tauri/src/elgato.rs +++ b/src-tauri/src/elgato.rs @@ -1,3 +1,4 @@ +use crate::device_sleep::is_device_sleeping; use crate::encoder_layouts::generate_encoder_image; use crate::events::inbound; @@ -129,6 +130,15 @@ pub async fn reset_devices() { } } +/// Wake up certain kinds of devices that do not wake themselves after the computer resumes from sleep. +pub async fn wake_deeply_sleeping_devices() { + for (id, device) in ELGATO_DEVICES.read().await.iter() { + if device.kind() == Kind::Plus && !is_device_sleeping(id) { + set_brightness(id, crate::store::get_settings().value.brightness).await; + } + } +} + async fn init(device: AsyncStreamDeck, device_id: String) { if ELGATO_DEVICES.read().await.contains_key(&device_id) { return; diff --git a/src-tauri/src/power_events.rs b/src-tauri/src/power_events.rs index 88e7ce1..454f335 100644 --- a/src-tauri/src/power_events.rs +++ b/src-tauri/src/power_events.rs @@ -26,6 +26,9 @@ pub fn init_power_events() { }); } PowerState::Resume => { + tauri::async_runtime::spawn(async { + crate::elgato::wake_deeply_sleeping_devices().await; + }); tauri::async_runtime::spawn(async { if let Err(error) = crate::events::outbound::misc::system_did_wake_up().await { log::error!("Failed to send the systemDidWakeUp event: {error}");