diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-03-23 19:40:16 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-03-23 19:40:16 -0400 |
commit | 48d8af85d08b8937f4105535d88302c7a20909aa (patch) | |
tree | 7b0a744254e61aaed34a7bc0fd18c72ae7d4ddcd /gdk/gdk.c | |
parent | c5d7871edae195b7d7f035ed46449b5e8fa5073f (diff) | |
download | gtk+-48d8af85d08b8937f4105535d88302c7a20909aa.tar.gz |
Make gdk_display_open_default_libgtk_only more robust
Make this function return NULL if GDK could not be
initialized. We check this by seeing if there is a
display manager singleton.
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r-- | gdk/gdk.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -350,7 +350,7 @@ gdk_get_display_arg_name (void) * * Opens the default display specified by command line arguments or * environment variables, sets it as the default display, and returns - * it. gdk_parse_args must have been called first. If the default + * it. gdk_parse_args() must have been called first. If the default * display has previously been set, simply returns that. An internal * function that should not be used by applications. * @@ -364,6 +364,9 @@ gdk_display_open_default_libgtk_only (void) g_return_val_if_fail (gdk_initialized, NULL); + if (gdk_display_manager_peek () == NULL) + return NULL; + display = gdk_display_get_default (); if (display) return display; |