[gtk+/wip/garnacho/gdkseat: 62/74] GtkTreeView: Use gdk_seat_grab()



commit abe19c212602c6b6be7411ad1a1241bb38122218
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 26 19:56:41 2015 +0100

    GtkTreeView: Use gdk_seat_grab()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759309

 gtk/gtktreeview.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c14a4fb..0f0bed6 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -3586,9 +3586,11 @@ gtk_tree_view_column_drag_gesture_end (GtkGestureDrag *gesture,
 
   if (tree_view->priv->in_column_drag)
     {
+      GdkDevice *device;
+
       gtk_tree_view_button_release_drag_column (tree_view);
-      gdk_device_ungrab (gtk_gesture_get_device (GTK_GESTURE (gesture)),
-                         GDK_CURRENT_TIME);
+      device = gtk_gesture_get_device (GTK_GESTURE (gesture));
+      gdk_seat_ungrab (gdk_device_get_seat (device));
     }
   else if (tree_view->priv->in_column_resize)
     gtk_tree_view_button_release_column_resize (tree_view);
@@ -10014,15 +10016,10 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
   /* 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);
+  gdk_seat_grab (gdk_device_get_seat (device),
+                 tree_view->priv->drag_window,
+                 GDK_SEAT_CAPABILITY_ALL, FALSE,
+                 NULL, NULL, NULL, NULL);
 
   gtk_gesture_set_state (tree_view->priv->column_drag_gesture,
                          GTK_EVENT_SEQUENCE_CLAIMED);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]