@@ -257,12 +257,12 @@ fn zoom_window(window: tauri::Window, scale_factor: f64) {
257257 } ) ;
258258}
259259
260- fn process_window_event ( event : & GlobalWindowEvent ) {
261- if let tauri :: WindowEvent :: CloseRequested { .. } = event . event ( ) {
262- // this does nothing and is here if in future you need to persist something on window close.
263- boot_config :: write_boot_config ( 1 ) ;
264- }
265- }
260+ // here in case you need to process windows events
261+ // fn process_window_event(event: &GlobalWindowEvent ) {
262+ // if let tauri::WindowEvent::CloseRequested { .. } = event.event() {
263+ // // this does nothing and is here if in future you need to persist something on window close.
264+ // }
265+ // }
266266
267267// convert url of form "protocol://host/v1.2.3/path/to/something" to "protocol://host/path/to/something"
268268fn remove_version_from_url ( url : & str ) -> String {
@@ -431,7 +431,7 @@ fn main() {
431431
432432 app. emit_all ( "single-instance" , Payload { args : argv, cwd } ) . unwrap ( ) ;
433433 } ) )
434- . on_window_event ( |event| process_window_event ( & event) )
434+ // .on_window_event(|event| process_window_event(&event))
435435 . invoke_handler ( tauri:: generate_handler![
436436 get_mac_deep_link_requests, get_process_id,
437437 toggle_devtools, console_log, console_error, _get_commandline_args, get_current_working_dir,
@@ -440,7 +440,14 @@ fn main() {
440440 _get_windows_drives, _rename_path, show_in_folder, move_to_trash, zoom_window,
441441 _get_clipboard_files, _open_url_in_browser_win] )
442442 . setup ( |app| {
443- init:: init_app ( app) ;
443+ let boot_config = init:: init_app ( app) ;
444+
445+ if boot_config. start_as_hidden_window {
446+ if let Some ( main_window) = app. get_window ( "main" ) {
447+ main_window. hide ( ) . expect ( "Failed to hide main window" ) ;
448+ }
449+ }
450+
444451 #[ cfg( target_os = "linux" ) ]
445452 {
446453 // In linux, f10 key press events are reserved for gtk-menu-bar-accel and not passed.
0 commit comments