diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-07-09 16:20:01 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-07-09 21:28:46 -0400 |
commit | edc5cb4e473c8036e56eb86f4d16cf1c36ecb43e (patch) | |
tree | 9a188f6635ddbbd19ed05c700c47b49ac864b168 /gtk/gtktreeview.c | |
parent | 5fb9c4441eb8e1b2db0ea321d38278f122effd5b (diff) | |
download | gtk+-edc5cb4e473c8036e56eb86f4d16cf1c36ecb43e.tar.gz |
treeview: Add back the Gdk pointer grab during column dragging
The reparenting happening on the column header so it gets a movable
window breaks the implicit grab, so this is one situation were we
want a pointer grab, if just to replace it.
https://bugzilla.gnome.org/show_bug.cgi?id=732933
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r-- | gtk/gtktreeview.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 7a64921f03..adc4561425 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3533,7 +3533,11 @@ gtk_tree_view_column_drag_gesture_end (GtkGestureDrag *gesture, tree_view->priv->cur_reorder = NULL; if (tree_view->priv->in_column_drag) - gtk_tree_view_button_release_drag_column (tree_view); + { + gtk_tree_view_button_release_drag_column (tree_view); + gdk_device_ungrab (gtk_gesture_get_device (GTK_GESTURE (gesture)), + GDK_CURRENT_TIME); + } else if (tree_view->priv->in_column_resize) gtk_tree_view_button_release_column_resize (tree_view); } @@ -9999,6 +10003,19 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, tree_view->priv->in_column_drag = TRUE; + /* Widget reparenting above unmaps and indirectly breaks + * the implicit grab, replace it with an active one. + */ + gdk_device_grab (device, + tree_view->priv->drag_window, + GDK_OWNERSHIP_NONE, + FALSE, + GDK_TOUCH_MASK | + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_RELEASE_MASK, + NULL, + GDK_CURRENT_TIME); + gtk_gesture_set_state (tree_view->priv->column_drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED); } |