gtkdnd: Traverse across insensitive widgets
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 1 Jul 2015 16:46:30 +0000 (18:46 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 6 Jul 2015 16:19:07 +0000 (18:19 +0200)
The current widget lookup code bails out on insensitive widgets, there's
however legit cases where we want DnD handled by a parent of the insensitive
widget, so just keep going upwards in that case.

We also use now the widget state flags, because get_sensitive() doesn't
propagate across hierarchies, so we could conceivably find a drop site
inside an insensitive widget.

https://bugzilla.gnome.org/show_bug.cgi?id=751793

gtk/gtkdnd.c

index 3f63d5b36392bf6aa4d7fdbb3af6c7fe5a6f0248..732d237231f588aa42c75f763550f09212c7b111 100644 (file)
@@ -1881,10 +1881,15 @@ gtk_drag_find_widget (GtkWidget           *widget,
       GList *hierarchy = NULL;
       gboolean found = FALSE;
 
-      if (!gtk_widget_get_mapped (widget) ||
-          !gtk_widget_get_sensitive (widget))
+      if (!gtk_widget_get_mapped (widget))
         return FALSE;
 
+      if (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE)
+        {
+          widget = gtk_widget_get_parent (widget);
+          continue;
+        }
+
       /* need to reference the entire hierarchy temporarily in case the
        * ::drag-motion/::drag-drop callbacks change the widget hierarchy.
        */