fix: set focus
This commit is contained in:
parent
7ffecba549
commit
575311b40d
@ -25,9 +25,16 @@ pub fn run() {
|
||||
button_state: MouseButtonState::Up,
|
||||
..
|
||||
} => {
|
||||
icon.app_handle()
|
||||
.get_window("main").unwrap()
|
||||
.show().unwrap();
|
||||
let window = icon.app_handle().get_window("main").unwrap();
|
||||
if !window.is_visible().unwrap() {
|
||||
window.show().unwrap();
|
||||
}
|
||||
if window.is_minimized().unwrap() {
|
||||
window.unminimize().unwrap();
|
||||
}
|
||||
if !window.is_focused().unwrap() {
|
||||
window.set_focus().unwrap();
|
||||
}
|
||||
println!("Tray icon clicked");
|
||||
}
|
||||
_ => {}
|
||||
|
Loading…
Reference in New Issue
Block a user