PATCH/HEAD: gdk_window_foreign_new (non-gdk-window)



Hi,

when you call gdk_window_foreign_new with the XID of a window whose
parent is not a gdk window, this will crash.

Here's a patch (against HEAD):

====
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1231
diff -u -u -r1.1231 ChangeLog
--- ChangeLog	2000/04/26 22:53:00	1.1231
+++ ChangeLog	2000/04/30 02:03:09
@@ -1,3 +1,8 @@
+2000-04-30  Martin Baulig  <martin@home-of-linux.org>
+
+	* gdk/x11/gdkwindow-x11.c (gdk_window_foreign_new): If
+	private->parent is NULL, use the gdk_display.
+
 2000-04-26  Havoc Pennington  <hp@redhat.com>
 
 	* gtk/gtklabel.c (gtk_label_get_text): Add this function,
Index: gdk/x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.88
diff -u -u -r1.88 gdkwindow-x11.c
--- gdk/x11/gdkwindow-x11.c	2000/03/28 01:24:43	1.88
+++ gdk/x11/gdkwindow-x11.c	2000/04/30 02:03:11
@@ -463,7 +463,8 @@
     parent_private->children = g_list_prepend (parent_private->children, window);
   
   GDK_DRAWABLE_XDATA (window)->xid = anid;
-  GDK_DRAWABLE_XDATA (window)->xdisplay = GDK_DRAWABLE_XDISPLAY (private->parent);
+  GDK_DRAWABLE_XDATA (window)->xdisplay = private->parent ? 
+      GDK_DRAWABLE_XDISPLAY (private->parent) : gdk_display;
 
   private->x = attrs.x;
   private->y = attrs.y;

====

-- 
Martin Baulig - martin@home-of-linux.org - http://www.home-of-linux.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]