gdk-pixbuf bug and one-line fix : 86931



Hi:

gdk_pixbuf_xlib_get_from_drawable() (in contrib) currently won't work if
the drawable you pass in is the root window.  This turns out to be
solely because of a broken sanity check assertion which expects the
'parent' of the drawable to be non-null.

The code runs fine with the following one-line patch, which allows the
test to succeed of the drawable passed in is the same as the root window
returned from the XQueryTree in xlib_window_is_viewable().

May I please commit?  Fixing this will let me kill about 1000 lines of
nasty cut-and-paste code in module gnome-mag...

thanks

-Bill

Index: contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-drawable.c
===================================================================
RCS file:
/cvs/gnome/gtk+/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-drawable.c,v
retrieving revision 1.2
diff -u -r1.2 gdk-pixbuf-xlib-drawable.c
--- contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-drawable.c	25 Jan 2002
21:38:13 -0000	1.2
+++ contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-drawable.c	30 Jun 2002
19:59:15 -0000
@@ -1145,7 +1145,7 @@
 		if (nchildren > 0)
 			XFree (children);
 
-		if (parent == root)
+		if ((parent == root) || (w == root))
 			return TRUE;
 
 		w = parent;








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