File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ namespace SwayNotificationCenter {
88
99 static Settings self_settings;
1010
11- public void main (string [] args ) {
11+ static bool activated = false ;
12+
13+ public int main (string [] args ) {
1214 Gtk . init ();
1315 Adw . init ();
1416 Functions . init ();
@@ -33,23 +35,30 @@ namespace SwayNotificationCenter {
3335 case " -v" :
3436 case " --version" :
3537 stdout. printf (" %s\n " , Constants . VERSION );
36- return ;
38+ return 0 ;
3739 case " -h" :
3840 case " --help" :
41+ print_help (args);
42+ return 0 ;
3943 default:
4044 print_help (args);
41- return ;
45+ return 1 ;
4246 }
4347 }
4448 }
4549
4650 var app = new Gtk .Application (" org.erikreider.swaync" ,
4751 ApplicationFlags . DEFAULT_FLAGS );
48- app. hold ();
4952 app. activate. connect (() = > {
53+ if (activated) {
54+ return ;
55+ }
56+ activated = true ;
5057 ConfigModel . init (config_path);
5158 Functions . load_css (style_path);
5259
60+ app. hold ();
61+
5362 swaync_daemon = new SwayncDaemon ();
5463 Bus . own_name (BusType . SESSION , " org.erikreider.swaync.cc" ,
5564 BusNameOwnerFlags . NONE ,
@@ -64,7 +73,7 @@ namespace SwayNotificationCenter {
6473 app. add_window (swaync_daemon. noti_daemon. control_center);
6574 });
6675
67- app. run ();
76+ return app. run ();
6877 }
6978
7079 void on_cc_bus_aquired (DBusConnection conn ) {
You can’t perform that action at this time.
0 commit comments