summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-01-28 12:04:13 +0100
committerCarlos Garnacho <carlosg@gnome.org>2016-01-28 12:50:49 +0100
commit2c0446917d3a606fd9336e444a6241f9a02f5b03 (patch)
tree3f7c7cd70dca34738300683fe1700ea189eafbe9 /demos
parent0125aa0a414a73d781bab7f531a534b774857eac (diff)
downloadgtk+-2c0446917d3a606fd9336e444a6241f9a02f5b03.tar.gz
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.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/changedisplay.c13
1 files 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;