From 8749648d97e12da94857a7588411ada599fbf818 Mon Sep 17 00:00:00 2001 From: wonfen Date: Sun, 2 Feb 2025 11:37:10 +0800 Subject: [PATCH] fix: restore hotkey functionality after silent startup --- src-tauri/src/core/hotkey.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/core/hotkey.rs b/src-tauri/src/core/hotkey.rs index de2d764c..e29d854d 100755 --- a/src-tauri/src/core/hotkey.rs +++ b/src-tauri/src/core/hotkey.rs @@ -65,9 +65,11 @@ impl Hotkey { _ => bail!("invalid function \"{func}\""), }; + let is_quit = func.trim() == "quit"; + let _ = manager.on_shortcut(hotkey, move |app_handle, hotkey, event| { if event.state == ShortcutState::Pressed { - if hotkey.key == Code::KeyQ { + if hotkey.key == Code::KeyQ && is_quit { if let Some(window) = app_handle.get_webview_window("main") { if window.is_focused().unwrap_or(false) { f();