about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-04-17 23:57:05 +0100
committerJames Booth <boothj5@gmail.com>2016-04-17 23:57:05 +0100
commit507ea5746c277fea83984c551ffd9e8c445effb5 (patch)
treef38076b4174550ee7bffee18d20e4ee901e527d4
parent153552ed074d0890e9ccbb3618a9c44309d7ff65 (diff)
downloadprofani-tty-507ea5746c277fea83984c551ffd9e8c445effb5.tar.gz
Grouped tray icon initialisation code
-rw-r--r--src/profanity.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/profanity.c b/src/profanity.c
index 4ca649cd..79d13c08 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -103,14 +103,6 @@ static gboolean gtk_ready = FALSE;
 void
 prof_run(char *log_level, char *account_name)
 {
-#ifdef HAVE_GTK
-    gtk_ready = gtk_init_check(0, NULL);
-    log_debug("Env is GTK-ready: %s", gtk_ready ? "true" : "false");
-    if (gtk_ready) {
-        gtk_init(0, NULL);
-        gtk_main_iteration_do(FALSE);
-    }
-#endif
     _init(log_level);
     plugins_on_start();
     _connect_default(account_name);
@@ -373,9 +365,15 @@ _init(char *log_level)
     atexit(_shutdown);
     plugins_init();
 #ifdef HAVE_GTK
-    if (gtk_ready && prefs_get_boolean(PREF_TRAY)) {
-        log_debug("Building GTK icon");
-        create_tray();
+    gtk_ready = gtk_init_check(0, NULL);
+    log_debug("Env is GTK-ready: %s", gtk_ready ? "true" : "false");
+    if (gtk_ready) {
+        gtk_init(0, NULL);
+        gtk_main_iteration_do(FALSE);
+        if (prefs_get_boolean(PREF_TRAY)) {
+            log_debug("Building GTK icon");
+            create_tray();
+        }
     }
 #endif
     inp_nonblocking(TRUE);