[dia/dia-0-97] Bug 721851 - Command line export not working for pixbuf



commit 276ce968d91964fcaa64f77826ad14eb4fba555f
Author: Hans Breuer <hans breuer org>
Date:   Sun Mar 2 19:24:48 2014 +0100

    Bug 721851 - Command line export not working for pixbuf
    
    The pixbuf export requires a diaplay. Use gtk_init_check() to
    allow command line export from an X terminal without sacrificing
    the command line mode without X11.
    
    (cherry picked from commit c3dcf1eec1b4ef57c45c58410048b77c83ea50dd)

 app/app_procs.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index 9a42ba8..d0f2d3d 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -862,14 +862,13 @@ app_init (int argc, char **argv)
     g_thread_init (NULL);
 #endif
     g_type_init();
-#ifdef GDK_WINDOWING_WIN32
     /*
-     * On windoze there is no command line without display so this call is harmless. 
-     * But it is needed to avoid failing in gdk functions just because there is a 
-     * display check. Still a little hack ...
+     * On Windows there is no command line without display so that gtk_init is harmless. 
+     * On X11 we need gtk_init_check() to avoid exit() just because there is no display 
+     * running outside of X11.
      */
-    gtk_init(&argc, &argv);
-#endif
+    if (!gtk_init_check(&argc, &argv))
+      dia_log_message ("Running without display");
   }
 
   /* done with option parsing, don't leak */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]