Bug 1249604 - Don't use gtk_drag_set_icon_surface on GTK versions that use X SHAPE for dnd with cairo. r?karlt
MozReview-Commit-ID: 2XxnJfvfOXl
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -463,16 +463,23 @@ nsDragService::SetAlphaPixmap(SourceSurf
gtk_drag_set_icon_pixmap(aContext, alphaColormap, pixmap, nullptr,
aXOffset, aYOffset);
g_object_unref(pixmap);
return true;
#else
#ifdef cairo_image_surface_create
#error "Looks like we're including Mozilla's cairo instead of system cairo"
#endif
+ // Prior to GTK 3.9.12, cairo surfaces passed into gtk_drag_set_icon_surface
+ // had their shape information derived from the alpha channel and used with
+ // the X SHAPE extension instead of being displayed as an ARGB window.
+ // See bug 1249604.
+ if (gtk_check_version(3, 9, 12))
+ return false;
+
// TODO: grab X11 pixmap or image data instead of expensive readback.
cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
dragRect.width,
dragRect.height);
if (!surf)
return false;
RefPtr<DrawTarget> dt = gfxPlatform::GetPlatform()->