Commits

jjacky committed 36f1c57

show error message if gtk_init fails (e.g. ran from tty, etc)

  • Participants
  • Parent commits 67cfa7d

Comments (0)

Files changed (1)

     #ifndef DISABLE_GUI
     if (!is_cli)
     {
-        gtk_init (&argc, &argv);
+        if (!gtk_init_check (&argc, &argv))
+        {
+            fputs ("GTK+ initialization failed\n", stderr);
+            puts ("To run kalu on CLI only mode, use --auto-checks or --manual-checks");
+            free_config ();
+            return 1;
+        }
     }
     #endif
     if (curl_global_init (CURL_GLOBAL_ALL) == 0)