From 2c0446917d3a606fd9336e444a6241f9a02f5b03 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 28 Jan 2016 12:04:13 +0100 Subject: [PATCH] demos: Modify "Change display" demo to use seat grabs The window picking feature was done through a pointer grab, replace it by a seat grab on pointing devices. --- demos/gtk-demo/changedisplay.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c index f51d091596..37c364f3e8 100644 --- a/demos/gtk-demo/changedisplay.c +++ b/demos/gtk-demo/changedisplay.c @@ -108,6 +108,7 @@ query_for_toplevel (GdkScreen *screen, GtkWidget *popup, *label, *frame; GdkCursor *cursor; GtkWidget *toplevel = NULL; + GdkDevice *device; popup = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (popup), screen); @@ -124,14 +125,12 @@ query_for_toplevel (GdkScreen *screen, gtk_widget_show_all (popup); cursor = gdk_cursor_new_from_name (display, "crosshair"); + device = gtk_get_current_event_device (); - if (gdk_device_grab (gtk_get_current_event_device (), - gtk_widget_get_window (popup), - GDK_OWNERSHIP_NONE, - FALSE, - GDK_BUTTON_RELEASE_MASK, - cursor, - GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) + if (gdk_seat_grab (gdk_device_get_seat (device), + gtk_widget_get_window (popup), + GDK_SEAT_CAPABILITY_ALL_POINTING, + FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS) { gboolean clicked = FALSE;