[gtk+/wip/garnacho/gdkseat: 12/14] GtkNotebook: Use gdk_seat_grab()



commit 84f0d0aa1ef9dab7c9f3ea5be4b41bda629115f7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 26 19:56:25 2015 +0100

    GtkNotebook: Use gdk_seat_grab()

 gtk/gtknotebook.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 6871074..e75db19 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3132,6 +3132,17 @@ get_drop_position (GtkNotebook *notebook)
 }
 
 static void
+prepare_drag_window (GdkSeat   *seat,
+                     GdkWindow *window,
+                     gpointer   user_data)
+{
+  GtkNotebook *notebook = user_data;
+  GtkNotebookPrivate *priv = notebook->priv;
+
+  gdk_window_show (priv->drag_window);
+}
+
+static void
 show_drag_window (GtkNotebook        *notebook,
                   GtkNotebookPrivate    *priv,
                   GtkNotebookPage    *page,
@@ -3168,13 +3179,10 @@ show_drag_window (GtkNotebook        *notebook,
   gtk_widget_set_parent (page->tab_label, widget);
   g_object_unref (page->tab_label);
 
-  gdk_window_show (priv->drag_window);
-
   /* the grab will dissapear when the window is hidden */
-  gdk_device_grab (device, priv->drag_window,
-                   GDK_OWNERSHIP_WINDOW, FALSE,
-                   GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
-                   NULL, GDK_CURRENT_TIME);
+  gdk_seat_grab (gdk_device_get_seat (device), priv->drag_window,
+                 GDK_SEAT_CAPABILITY_ALL, FALSE,
+                 NULL, NULL, prepare_drag_window, notebook);
 }
 
 /* This function undoes the reparenting that happens both when drag_window


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