@@ -352,9 +352,15 @@ impl Application for AppState {
352352
353353 let mut commands = Vec :: new ( ) ;
354354
355- let ( new_id, command) = cosmic:: iced:: window:: open ( settings) ;
355+ let main_window = if flags. config . data ( ) . start_minimized {
356+ None
357+ } else {
358+ let ( new_id, command) = cosmic:: iced:: window:: open ( settings) ;
356359
357- commands. push ( command. map ( |_| cosmic:: action:: Action :: None ) ) ;
360+ commands. push ( command. map ( |_| cosmic:: action:: Action :: None ) ) ;
361+
362+ Some ( CustomWindow { window_id : new_id } )
363+ } ;
358364
359365 let mut app = Self {
360366 core,
@@ -368,7 +374,7 @@ impl Application for AppState {
368374 connection_state : ConnectionState :: Default ,
369375 network_adapters,
370376 network_adapter,
371- main_window : Some ( CustomWindow { window_id : new_id } ) ,
377+ main_window,
372378 settings_window : None ,
373379 about_window : None ,
374380 logs : Vec :: new ( ) ,
@@ -393,7 +399,9 @@ impl Application for AppState {
393399 info ! ( "config path: {}" , flags. config_path) ;
394400 info ! ( "log path: {}" , flags. log_path) ;
395401
396- commands. push ( app. set_window_title ( fl ! ( "main_window_title" ) , new_id) ) ;
402+ if let Some ( main_window) = & app. main_window {
403+ commands. push ( app. set_window_title ( fl ! ( "main_window_title" ) , main_window. window_id ) ) ;
404+ }
397405
398406 ( app, Task :: batch ( commands) )
399407 }
@@ -661,6 +669,9 @@ impl Application for AppState {
661669 . update ( |c| c. speex_dereverb_level = speex_dereverb_level) ;
662670 return self . update_audio_stream ( ) ;
663671 }
672+ ConfigMsg :: StartMinimized ( start_minimized) => {
673+ self . config . update ( |s| s. start_minimized = start_minimized) ;
674+ }
664675 } ,
665676 AppMsg :: HideWindow => {
666677 let mut effects = Vec :: new ( ) ;
0 commit comments