From 91b5497d69043ae0ab00c70390e20c57c32a0a93 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 26 Nov 2015 19:56:25 +0100 Subject: [PATCH] GtkNotebook: Use gdk_seat_grab() https://bugzilla.gnome.org/show_bug.cgi?id=759309 --- gtk/gtknotebook.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index bb50c0bab1..6dddcb8f1e 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3121,6 +3121,14 @@ get_drop_position (GtkNotebook *notebook) return last_child; } +static void +prepare_drag_window (GdkSeat *seat, + GdkWindow *window, + gpointer user_data) +{ + gdk_window_show (window); +} + static void show_drag_window (GtkNotebook *notebook, GtkNotebookPrivate *priv, @@ -3158,13 +3166,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