mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:53:44 +08:00
fix: restore hotkey functionality after silent startup
This commit is contained in:
parent
0b75b5ef26
commit
8749648d97
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user