summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-03-06 17:34:35 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-03-06 17:34:35 +0000
commitede969587570b85b93472e79f2ac7f7ce5f2e21a (patch)
tree9dfeeab0ae9e9bb0cc3fa7d01fcbcb6a7dc3c90b /gtk
parenta319bd94def8080e1c411d6216cea5f5b4a3072e (diff)
downloadgtk+-ede969587570b85b93472e79f2ac7f7ce5f2e21a.tar.gz
Set error when returning FALSE. (#333268, Paolo Maggi, Christian Persch)
2006-03-06 Matthias Clasen <mclasen@redhat.com> * gtk/gtkmain.c (post_parse_hook): Set error when returning FALSE. (#333268, Paolo Maggi, Christian Persch)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkmain.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index d31dbce25f..3d767c12cf 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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;
}