File tree Expand file tree Collapse file tree 7 files changed +17
-10
lines changed Expand file tree Collapse file tree 7 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1048,8 +1048,9 @@ tauri::Builder::default()
1048
1048
{
1049
1049
let app = tray . app_handle ();
1050
1050
if let Some (webview_window ) = app . get_webview_window (" main" ) {
1051
- let _ = webview_window . show ();
1052
- let _ = webview_window . set_focus ();
1051
+ let _ = webview_window . unminimize ();
1052
+ let _ = webview_window . show ();
1053
+ let _ = webview_window . set_focus ();
1053
1054
}
1054
1055
}
1055
1056
})
Original file line number Diff line number Diff line change @@ -978,8 +978,9 @@ tauri::Builder::default()
978
978
{
979
979
let app = tray . app_handle ();
980
980
if let Some (webview_window ) = app . get_webview_window (" main" ) {
981
- let _ = webview_window . show ();
982
- let _ = webview_window . set_focus ();
981
+ let _ = webview_window . unminimize ();
982
+ let _ = webview_window . show ();
983
+ let _ = webview_window . set_focus ();
983
984
}
984
985
}
985
986
})
Original file line number Diff line number Diff line change @@ -1048,8 +1048,9 @@ tauri::Builder::default()
1048
1048
{
1049
1049
let app = tray . app_handle ();
1050
1050
if let Some (webview_window ) = app . get_webview_window (" main" ) {
1051
- let _ = webview_window . show ();
1052
- let _ = webview_window . set_focus ();
1051
+ let _ = webview_window . unminimize ();
1052
+ let _ = webview_window . show ();
1053
+ let _ = webview_window . set_focus ();
1053
1054
}
1054
1055
}
1055
1056
})
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ TrayIconBuilder::new()
292
292
// in this example, let's show and focus the main window when the tray is clicked
293
293
let app = tray . app_handle ();
294
294
if let Some (window ) = app . get_webview_window (" main" ) {
295
+ let _ = window . unminimize ();
295
296
let _ = window . show ();
296
297
let _ = window . set_focus ();
297
298
}
Original file line number Diff line number Diff line change @@ -1056,8 +1056,9 @@ tauri::Builder::default()
1056
1056
{
1057
1057
let app = tray . app_handle ();
1058
1058
if let Some (webview_window ) = app . get_webview_window (" main" ) {
1059
- let _ = webview_window . show ();
1060
- let _ = webview_window . set_focus ();
1059
+ let _ = webview_window . unminimize ();
1060
+ let _ = webview_window . show ();
1061
+ let _ = webview_window . set_focus ();
1061
1062
}
1062
1063
}
1063
1064
})
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ TrayIconBuilder::new()
291
291
// 在这个例子中,当点击托盘图标时,将展示并聚焦于主窗口
292
292
let app = tray . app_handle ();
293
293
if let Some (window ) = app . get_webview_window (" main" ) {
294
+ let _ = window . unminimize ();
294
295
let _ = window . show ();
295
296
let _ = window . set_focus ();
296
297
}
Original file line number Diff line number Diff line change @@ -1049,8 +1049,9 @@ tauri::Builder::default()
1049
1049
{
1050
1050
let app = tray . app_handle ();
1051
1051
if let Some (webview_window ) = app . get_webview_window (" main" ) {
1052
- let _ = webview_window . show ();
1053
- let _ = webview_window . set_focus ();
1052
+ let _ = webview_window . unminimize ();
1053
+ let _ = webview_window . show ();
1054
+ let _ = webview_window . set_focus ();
1054
1055
}
1055
1056
}
1056
1057
})
You can’t perform that action at this time.
0 commit comments