Bug 1264454 - Disable drag popups on GTK versions with a buggy gtk_drag_set_icon_widget. r?karlt
MozReview-Commit-ID: Bsum6dNbFXc
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -1663,17 +1663,21 @@ void nsDragService::SetDragIcon(GdkDragC
int32_t sx = mScreenX, sy = mScreenY;
ConvertToUnscaledDevPixels(pc, &sx, &sy);
int32_t offsetX = sx - dragRect.x;
int32_t offsetY = sy - dragRect.y;
// If a popup is set as the drag image, use its widget. Otherwise, use
// the surface that DrawDrag created.
- if (mDragPopup) {
+ //
+ // XXX: Disable drag popups on GTK 3.19.4 and above: see bug 1264454.
+ // Fix this once a new GTK version ships that does not destroy our
+ // widget in gtk_drag_set_icon_widget.
+ if (mDragPopup && gtk_check_version(3, 19, 4)) {
GtkWidget* gtkWidget = nullptr;
nsIFrame* frame = mDragPopup->GetPrimaryFrame();
if (frame) {
// DrawDrag ensured that this is a popup frame.
nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget();
if (widget) {
gtkWidget = (GtkWidget *)widget->GetNativeData(NS_NATIVE_SHELLWIDGET);
if (gtkWidget) {