summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-09-27 15:12:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-09-27 15:12:47 -0400
commit8a7d0ab4813457088335685e956313afbd1d65a1 (patch)
tree422e493a2c1a88c7f042e0fba7544e463298cdea
parent6181ff255251ce9cde231c6db8c04e4f4bb1d71b (diff)
downloadgtk+-8a7d0ab4813457088335685e956313afbd1d65a1.tar.gz
Make gtk_init_with_args behave as documented
This docs say it should return FALSE if the display can't be opened, but it was failing. https://bugzilla.gnome.org/show_bug.cgi?id=771959
-rw-r--r--gtk/gtkmain.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index ad6ed506a4..5c0dcb1884 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -963,14 +963,14 @@ gtk_init_with_args (gint *argc,
gboolean retval;
if (gtk_initialized)
- return GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
+ goto done;
gettext_initialization ();
if (!check_setugid ())
return FALSE;
- gtk_group = gtk_get_option_group (TRUE);
+ gtk_group = gtk_get_option_group (FALSE);
context = g_option_context_new (parameter_string);
g_option_context_add_group (context, gtk_group);
@@ -982,7 +982,11 @@ gtk_init_with_args (gint *argc,
g_option_context_free (context);
- return retval;
+ if (!retval)
+ return FALSE;
+
+done:
+ return GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
}