Bug 1264454 - Disable drag popups on GTK versions with a buggy gtk_drag_set_icon_widget. r=karlt, a=sledru
authorAndrew Comminos <acomminos@mozilla.com>
Mon, 25 Apr 2016 19:04:55 -0700
changeset 324175 5a86ed5f7b6443210a9ade3945c87f91f1f86ba3
parent 324174 bd61104c52b815cffaf1561552d3e24778260157
child 324176 362b8365615be2a57cc3ba93fe33ea3412d61192
push id5926
push userkwierso@gmail.com
push dateFri, 29 Apr 2016 21:00:39 +0000
treeherdermozilla-beta@362b8365615b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, sledru
bugs1264454
milestone47.0
Bug 1264454 - Disable drag popups on GTK versions with a buggy gtk_drag_set_icon_widget. r=karlt, a=sledru MozReview-Commit-ID: Bsum6dNbFXc
widget/gtk/nsDragService.cpp
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -1661,17 +1661,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) {