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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user