changeset 102705:36389825b3d8

gtkutil.c (xg_display_open): Assign a value to gdpy_def, check that gdpy is set.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 23 Mar 2009 17:09:07 +0000
parents acda56dde7fb
children 86b3a54e3653
files src/gtkutil.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkutil.c	Mon Mar 23 16:25:30 2009 +0000
+++ b/src/gtkutil.c	Mon Mar 23 17:09:07 2009 +0000
@@ -119,9 +119,12 @@
   GdkDisplay *gdpy;
 
   gdpy = gdk_display_open (display_name);
-  if (!gdpy_def)
-    gdk_display_manager_set_default_display (gdk_display_manager_get (),
-					     gdpy);
+  if (!gdpy_def && gdpy)
+    {
+      gdpy_def = gdpy;
+      gdk_display_manager_set_default_display (gdk_display_manager_get (),
+					       gdpy);
+    }
 
   *dpy = gdpy ? GDK_DISPLAY_XDISPLAY (gdpy) : NULL;
   return gdpy != NULL;