From e4eeec2163b64c8484d4abc0dc16a2e59d3b4388 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 26 Nov 2015 19:54:01 +0100 Subject: [PATCH] GtkButton: Use gdk_seat_grab() https://bugzilla.gnome.org/show_bug.cgi?id=759309 --- gtk/gtkbutton.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 315a11bb1d..43473da4f4 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -2081,14 +2081,13 @@ gtk_real_button_activate (GtkButton *button) */ if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) { - if (gdk_device_grab (device, priv->event_window, - GDK_OWNERSHIP_WINDOW, TRUE, - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, - NULL, time) == GDK_GRAB_SUCCESS) - { - gtk_device_grab_add (widget, device, TRUE); - priv->grab_keyboard = device; - priv->grab_time = time; + if (gdk_seat_grab (gdk_device_get_seat (device), priv->event_window, + GDK_SEAT_CAPABILITY_KEYBOARD, TRUE, + NULL, NULL, NULL, NULL) == GDK_GRAB_SUCCESS) + { + gtk_device_grab_add (widget, device, TRUE); + priv->grab_keyboard = device; + priv->grab_time = time; } } @@ -2113,7 +2112,7 @@ gtk_button_finish_activate (GtkButton *button, if (priv->grab_keyboard) { - gdk_device_ungrab (priv->grab_keyboard, priv->grab_time); + gdk_seat_ungrab (gdk_device_get_seat (priv->grab_keyboard)); gtk_device_grab_remove (widget, priv->grab_keyboard); priv->grab_keyboard = NULL; }