]> Pileus Git - ~andy/gtk/commitdiff
Set error when returning FALSE. (#333268, Paolo Maggi, Christian Persch)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 6 Mar 2006 17:34:35 +0000 (17:34 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 6 Mar 2006 17:34:35 +0000 (17:34 +0000)
2006-03-06  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkmain.c (post_parse_hook): Set error when returning
FALSE.  (#333268, Paolo Maggi, Christian Persch)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkmain.c

index 6c353622d54959dc4355d1d9a4c89eb169b4e32c..22b99c4abcb9b596945ae0006922f6f76df98739 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-03-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkmain.c (post_parse_hook): Set error when returning
+       FALSE.  (#333268, Paolo Maggi, Christian Persch)
+       
        * gtk/gtkpixmap.c (gtk_pixmap_set): Check that the pixmap
        has the right depth.  (#333363, Ed Catmur)
 
index 6c353622d54959dc4355d1d9a4c89eb169b4e32c..22b99c4abcb9b596945ae0006922f6f76df98739 100644 (file)
@@ -1,5 +1,8 @@
 2006-03-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkmain.c (post_parse_hook): Set error when returning
+       FALSE.  (#333268, Paolo Maggi, Christian Persch)
+       
        * gtk/gtkpixmap.c (gtk_pixmap_set): Check that the pixmap
        has the right depth.  (#333363, Ed Catmur)
 
index d31dbce25f7b2e55fb8fa354a3a4ae47c24dc451..3d767c12cfecde71f830e1ade176a8505bce6221 100644 (file)
@@ -550,9 +550,20 @@ post_parse_hook (GOptionContext *context,
   do_post_parse_initialization (NULL, NULL);
   
   if (info->open_default_display)
-    return gdk_display_open_default_libgtk_only () != NULL;
-  else
-    return TRUE;
+    {
+      if (gdk_display_open_default_libgtk_only () == NULL)
+       {
+         g_set_error (error, 
+                      G_OPTION_ERROR, 
+                      G_OPTION_ERROR_FAILED,
+                      "cannot open display: %s",
+                      gdk_get_display_arg_name ());
+         
+         return FALSE;
+       }
+    }
+
+  return TRUE;
 }