File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1128,6 +1128,21 @@ pub fn run() {
11281128 let _ = app_handle. track_event ( "app_exited" , None ) ;
11291129 app_handle. flush_events_blocking ( ) ;
11301130 }
1131+ tauri:: RunEvent :: Reopen { .. } => {
1132+ // When the user clicks on the dock icon, show the window
1133+ if let Some ( window) = app_handle. get_webview_window ( "main" ) {
1134+ let _ = window. show ( ) ;
1135+ let _ = window. set_focus ( ) ;
1136+ // If the app was previously hidden from dock, restore it
1137+ #[ cfg( target_os = "macos" ) ]
1138+ {
1139+ let app_handle_clone = app_handle. clone ( ) ;
1140+ tauri:: async_runtime:: spawn ( async move {
1141+ let _ = set_dock_visibility ( app_handle_clone, true ) . await ;
1142+ } ) ;
1143+ }
1144+ }
1145+ }
11311146 _ => { }
11321147 } ) ;
11331148 } )
You can’t perform that action at this time.
0 commit comments