summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-06-13 15:18:56 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-06-15 17:46:51 +1000
commit7e571230690cd249811d63988bf4f8846dfe7e2a (patch)
tree55596793ab848e7dc5b27b06bf4f653e40e39a77 /tools
parent980ad92c886425cb7fb4cead44618c9c15692b14 (diff)
tools: grab the pointer in the debug gui
Because it's too annoying to trigger the hot corner every few seconds while pointer debugging. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/libinput-debug-gui.14
-rw-r--r--tools/libinput-debug-gui.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/tools/libinput-debug-gui.1 b/tools/libinput-debug-gui.1
index 1d289fd..e6d4d21 100644
--- a/tools/libinput-debug-gui.1
+++ b/tools/libinput-debug-gui.1
@@ -8,7 +8,9 @@ libinput\-debug\-gui \- visual debug helper for libinput
The
.B "libinput debug\-gui"
tool creates a libinput context and a full-screen GTK window to visualize
-events processed by libinput.
+events processed by libinput. This tool exclusively grabs pointing devices
+and stops them from interacting with the rest of the GUI.
+.B Hit Esc to exit this tool.
.PP
This is a debugging tool only, its output or behavior may change at any
time. Do not rely on the output or the behavior.
diff --git a/tools/libinput-debug-gui.c b/tools/libinput-debug-gui.c
index 4091b55..ae1d295 100644
--- a/tools/libinput-debug-gui.c
+++ b/tools/libinput-debug-gui.c
@@ -383,6 +383,7 @@ map_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
{
struct window *w = data;
GdkDisplay *display;
+ GdkSeat *seat;
GdkWindow *window;
gtk_window_get_size(GTK_WINDOW(widget), &w->width, &w->height);
@@ -410,6 +411,17 @@ map_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
gdk_window_set_cursor(gtk_widget_get_window(w->win),
gdk_cursor_new_for_display(display,
GDK_BLANK_CURSOR));
+
+ seat = gdk_display_get_default_seat(display);
+ gdk_seat_grab(seat,
+ window,
+ GDK_SEAT_CAPABILITY_ALL_POINTING,
+ FALSE, /* owner-events */
+ NULL, /* cursor */
+ NULL, /* triggering event */
+ NULL, /* prepare_func */
+ NULL /* prepare_func_data */
+ );
}
static void