Handle display_name being NULL. (#354004, Chris Wilson)

2006-09-03  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmain.c (post_parse_hook):
	* gdk/gdk.c (gdk_init): Handle display_name being NULL.
	(#354004, Chris Wilson)
This commit is contained in:
Matthias Clasen 2006-09-03 05:26:45 +00:00 committed by Matthias Clasen
parent f3ce0228a5
commit 805782a574
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-09-03 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmain.c (post_parse_hook):
* gdk/gdk.c (gdk_init): Handle display_name being NULL.
(#354004, Chris Wilson)
2006-09-03 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_beep): No

View File

@ -328,7 +328,8 @@ gdk_init (int *argc, char ***argv)
{
if (!gdk_init_check (argc, argv))
{
g_warning ("cannot open display: %s", gdk_get_display_arg_name ());
const char *display_name = gdk_get_display_arg_name ();
g_warning ("cannot open display: %s", display_name ? display_name : "");
exit(1);
}
}

View File

@ -551,11 +551,12 @@ post_parse_hook (GOptionContext *context,
{
if (gdk_display_open_default_libgtk_only () == NULL)
{
const char *display_name = gdk_get_display_arg_name ();
g_set_error (error,
G_OPTION_ERROR,
G_OPTION_ERROR_FAILED,
"cannot open display: %s",
gdk_get_display_arg_name ());
display_name ? display_name : "" );
return FALSE;
}