Don't crash in DND when the X server doesn't support SHAPE

Reported in bug 612768
(cherry picked from commit 996541d096)
This commit is contained in:
Matthias Clasen
2010-03-16 12:35:13 -04:00
parent 4b529ade7b
commit a66aa434f9

View File

@@ -4606,11 +4606,15 @@ _xwindow_get_shape (Display *xdisplay,
gint rn, ord, i;
shape = NULL;
rn = 0;
xrl = XShapeGetRectangles (xdisplay,
window,
shape_type, &rn, &ord);
if (xrl == NULL)
return NULL; /* XShape not supported */
if (rn == 0)
return gdk_region_new (); /* Empty */
@@ -4663,8 +4667,7 @@ _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
region = _xwindow_get_shape (GDK_DISPLAY_XDISPLAY (display),
window, ShapeBounding);
XDestroyWindow (GDK_DISPLAY_XDISPLAY (display),
window);
XDestroyWindow (GDK_DISPLAY_XDISPLAY (display), window);
return region;
}