summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-07-01 18:46:30 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-07-06 18:19:07 +0200
commit3f8982a0cd7b779fe023bbd19ec4cebf5baae422 (patch)
tree7ece9d86f4aa337eeaec1f011afc1e9877d35949 /gtk/gtkdnd.c
parent7f57f63ebaa8e3d12bdaef0ebc730cd81c9bb2fe (diff)
downloadgtk+-3f8982a0cd7b779fe023bbd19ec4cebf5baae422.tar.gz
gtkdnd: Traverse across insensitive widgets
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
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 3f63d5b363..732d237231 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -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.
*/