@@ -41,16 +41,10 @@ use crate::{
4141} ;
4242use zconf:: ConfigManager ;
4343
44- pub fn run_ui ( config : ConfigManager < Config > , config_path : String , log_path : String ) {
44+ pub fn run_ui ( flags : Flags ) {
4545 let settings = Settings :: default ( )
4646 . no_main_window ( true )
47- . theme ( to_cosmic_theme ( & config. data ( ) . theme ) ) ;
48-
49- let flags = Flags {
50- config,
51- config_path,
52- log_path,
53- } ;
47+ . theme ( to_cosmic_theme ( & flags. config . data ( ) . theme ) ) ;
5448
5549 cosmic:: app:: run :: < AppState > ( settings, flags) . unwrap ( ) ;
5650}
@@ -137,6 +131,7 @@ pub struct AppState {
137131 pub system_tray : Option < SystemTray > ,
138132 pub system_tray_stream : Option < SystemTrayStream > ,
139133 has_shown_minimize_notification : bool ,
134+ launched_automatically : bool ,
140135}
141136
142137pub struct CustomWindow {
@@ -274,9 +269,10 @@ impl AppState {
274269}
275270
276271pub struct Flags {
277- config : ConfigManager < Config > ,
278- config_path : String ,
279- log_path : String ,
272+ pub config : ConfigManager < Config > ,
273+ pub config_path : String ,
274+ pub log_path : String ,
275+ pub launched_automatically : bool ,
280276}
281277
282278// used because the markdown parsing only detect https links
@@ -386,6 +382,7 @@ impl Application for AppState {
386382 system_tray,
387383 system_tray_stream,
388384 has_shown_minimize_notification : false ,
385+ launched_automatically : flags. launched_automatically ,
389386 } ;
390387
391388 commands. push (
@@ -403,7 +400,7 @@ impl Application for AppState {
403400 info ! ( "config path: {}" , flags. config_path) ;
404401 info ! ( "log path: {}" , flags. log_path) ;
405402
406- if !app. config . data ( ) . start_minimized {
403+ if !flags . launched_automatically || ! app. config . data ( ) . start_minimized {
407404 commands. push ( app. open_main_window ( ) ) ;
408405 }
409406
@@ -719,7 +716,7 @@ impl Application for AppState {
719716 self . about_window = None ;
720717 }
721718
722- if !self . config . data ( ) . start_minimized && !self . has_shown_minimize_notification {
719+ if !self . launched_automatically && !self . has_shown_minimize_notification {
723720 let _ = Notification :: new ( )
724721 . summary ( "AndroidMic" )
725722 . body ( & fl ! ( "minimized_to_tray" ) )
0 commit comments