[PATCH] Deref gui initialization to after options parsing
authorNiclas Zeising <zeising@daemonic.se>
Mon, 9 Sep 2019 15:46:35 +0000 (17:46 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 1 Apr 2020 17:53:42 +0000 (18:53 +0100)
Move GUI initialisation when running with GDK until after options
parsing.  This way, help messages, version information and so on can be
printed even when no gui is around, such as running fontforge -version
from a configure script.

Forwarded: https://github.com/fontforge/fontforge/pull/3922
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952408
Applied-Upstream: https://github.com/fontforge/fontforge/commit/ee87536a63534bddc6535d18be793bc19294e274

Gbp-Pq: Name 3000-debian-bug-952408.patch

fontforgeexe/startui.c

index 39ff11217cbbec185a1475a4a9e747899de96d0b..ad27cf912fd46a4a227875ebf8f95bb1ac3d7f05 100644 (file)
@@ -1099,10 +1099,6 @@ int fontforge_main( int argc, char **argv ) {
     CheckIsScript(argc,argv); /* Will run the script and exit if it is a script */
                                        /* If there is no UI, there is always a script */
                                        /*  and we will never return from the above */
-#ifdef FONTFORGE_CAN_USE_GDK
-    gdk_init(&argc, &argv);
-    gdk_set_allowed_backends("win32,quartz,x11");
-#endif
     if ( load_prefs==NULL ||
            (strcasecmp(load_prefs,"Always")!=0 &&      /* Already loaded */
             strcasecmp(load_prefs,"Never")!=0 ))
@@ -1185,7 +1181,10 @@ int fontforge_main( int argc, char **argv ) {
        }
 #endif
     }
-
+#ifdef FONTFORGE_CAN_USE_GDK
+    gdk_init(&argc, &argv);
+    gdk_set_allowed_backends("win32,quartz,x11");
+#endif
     ensureDotFontForgeIsSetup();
 #if defined(__MINGW32__) && !defined(_NO_LIBCAIRO)
     //Load any custom fonts for the user interface