|
|
14c9f0 |
From 9077ef68bebee9a22d836a00af72aa02d5628ed4 Mon Sep 17 00:00:00 2001
|
|
|
14c9f0 |
From: Bastien Nocera <hadess@hadess.net>
|
|
|
14c9f0 |
Date: Fri, 16 Nov 2012 16:18:05 +0100
|
|
|
14c9f0 |
Subject: [PATCH] widget: Only show the cursor on motion if moved
|
|
|
14c9f0 |
|
|
|
14c9f0 |
Some devices, like Wacom tablets, will emit mouse motion
|
|
|
14c9f0 |
events even when the mouse doesn't move on the tablet. This
|
|
|
14c9f0 |
means that the mouse cursor will show up on the screen very shortly
|
|
|
14c9f0 |
after hiding.
|
|
|
14c9f0 |
|
|
|
14c9f0 |
We now check the motion event against the last location of the
|
|
|
14c9f0 |
mouse cursor to avoid this behaviour.
|
|
|
14c9f0 |
|
|
|
14c9f0 |
https://bugzilla.gnome.org/show_bug.cgi?id=688456
|
|
|
14c9f0 |
---
|
|
|
14c9f0 |
src/vte.c | 7 +++++--
|
|
|
14c9f0 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
14c9f0 |
|
|
|
14c9f0 |
diff --git a/src/vte.c b/src/vte.c
|
|
|
14c9f0 |
index bbe6cf6..c5922e6 100644
|
|
|
14c9f0 |
--- a/src/vte.c
|
|
|
14c9f0 |
+++ b/src/vte.c
|
|
|
14c9f0 |
@@ -7294,8 +7294,11 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
|
|
|
14c9f0 |
} else {
|
|
|
14c9f0 |
/* Hilite any matches. */
|
|
|
14c9f0 |
vte_terminal_match_hilite(terminal, x, y);
|
|
|
14c9f0 |
- /* Show the cursor. */
|
|
|
14c9f0 |
- _vte_terminal_set_pointer_visible(terminal, TRUE);
|
|
|
14c9f0 |
+ /* Show the cursor if we moved. */
|
|
|
14c9f0 |
+ if (event->type != GDK_MOTION_NOTIFY ||
|
|
|
14c9f0 |
+ x != terminal->pvt->mouse_last_x ||
|
|
|
14c9f0 |
+ y != terminal->pvt->mouse_last_y)
|
|
|
14c9f0 |
+ _vte_terminal_set_pointer_visible(terminal, TRUE);
|
|
|
14c9f0 |
}
|
|
|
14c9f0 |
|
|
|
14c9f0 |
switch (event->type) {
|
|
|
14c9f0 |
--
|
|
|
14c9f0 |
1.8.0
|
|
|
14c9f0 |
|