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()
10481048 {
10491049 let app = tray . app_handle ();
10501050 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 ();
10531054 }
10541055 }
10551056 })
Original file line number Diff line number Diff line change @@ -978,8 +978,9 @@ tauri::Builder::default()
978978 {
979979 let app = tray . app_handle ();
980980 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 ();
983984 }
984985 }
985986 })
Original file line number Diff line number Diff line change @@ -1048,8 +1048,9 @@ tauri::Builder::default()
10481048 {
10491049 let app = tray . app_handle ();
10501050 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 ();
10531054 }
10541055 }
10551056 })
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ TrayIconBuilder::new()
292292 // in this example, let's show and focus the main window when the tray is clicked
293293 let app = tray . app_handle ();
294294 if let Some (window ) = app . get_webview_window (" main" ) {
295+ let _ = window . unminimize ();
295296 let _ = window . show ();
296297 let _ = window . set_focus ();
297298 }
Original file line number Diff line number Diff line change @@ -1056,8 +1056,9 @@ tauri::Builder::default()
10561056 {
10571057 let app = tray . app_handle ();
10581058 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 ();
10611062 }
10621063 }
10631064 })
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ TrayIconBuilder::new()
291291 // 在这个例子中,当点击托盘图标时,将展示并聚焦于主窗口
292292 let app = tray . app_handle ();
293293 if let Some (window ) = app . get_webview_window (" main" ) {
294+ let _ = window . unminimize ();
294295 let _ = window . show ();
295296 let _ = window . set_focus ();
296297 }
Original file line number Diff line number Diff line change @@ -1049,8 +1049,9 @@ tauri::Builder::default()
10491049 {
10501050 let app = tray . app_handle ();
10511051 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 ();
10541055 }
10551056 }
10561057 })
You can’t perform that action at this time.
0 commit comments