diff --git a/src/app/state.rs b/src/app/state.rs index 26c95f7..a34b57b 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -463,8 +463,37 @@ fn setup_hotkeys(shared_state: Arc>) -> Option { println!("Received hotkey event: {:?}", event); if event.state == HotKeyState::Pressed { @@ -493,15 +522,8 @@ fn setup_hotkeys(shared_state: Arc>) -> Option { - // No events or channel disconnected, sleep briefly - std::thread::sleep(Duration::from_millis(50)); - } - } - // Check shared state running flag - if let Ok(state) = state_clone.lock() { - if !state.running { - println!("Hotkey listener detected running=false, exiting thread."); - break; + // Timeout or channel disconnected, just continue the loop + // No need to sleep as recv_timeout already waited } } }