Skip to content

Commit

Permalink
easy
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Oct 12, 2023
1 parent cbcf7da commit ac15733
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/events/window_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn window_event_listener() {
WindowEvent::Focused(false) => {
tauri::async_runtime::spawn(async {
printlog!("window lost focus");
std::thread::sleep(Duration::from_millis(100));
// std::thread::sleep(Duration::from_millis(100));
if *HOTKEY_RUNNING.get().unwrap().lock().unwrap() {
*HOTKEY_RUNNING.get().unwrap().lock().unwrap() = false;
return;
Expand Down
4 changes: 1 addition & 3 deletions src-tauri/src/utils/hotkey_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ pub fn unregister_hotkeys(all: bool) {
}
}

hotkey_manager
.unregister_all(&hotkeys_to_unregister)
.unwrap();
let _ = hotkey_manager.unregister_all(&hotkeys_to_unregister);
printlog!("unregister_hotkeys end");
}

Expand Down
10 changes: 10 additions & 0 deletions src-tauri/src/utils/tauri/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ pub fn system_tray_event(app: &tauri::AppHandle, event: SystemTrayEvent) {
size: _,
..
} => toggle_main_window(),
SystemTrayEvent::DoubleClick {
position: _,
size: _,
..
} => toggle_main_window(),
SystemTrayEvent::RightClick {
position: _,
size: _,
..
} => {}
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
"open" => toggle_main_window(),
"quit" => app.exit(1),
Expand Down

0 comments on commit ac15733

Please sign in to comment.