summarylogtreecommitdiffstats
path: root/0001-widget-Only-show-the-cursor-on-motion-if-moved.patch
blob: 5935eae80ea9dd6cc6d6a7a9e7762bedb378c7fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From f54c7051b61c0ab935fe64e6a69503ce3430bb9b Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 14 Sep 2015 14:22:35 +0200
Subject: [PATCH] widget: Only show the cursor on motion if moved

Some devices, like Wacom tablets, will emit mouse motion
events even when the mouse doesn't move on the tablet. This
means that the mouse cursor will show up on the screen very shortly
after hiding.

We now check the motion event against the last location of the
mouse cursor to avoid this behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=688456
---
 src/vte.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/vte.cc b/src/vte.cc
index 55e57dd3270a..1ec07a945812 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7321,8 +7321,11 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
 	} else {
 		/* Hilite any matches. */
 		vte_terminal_match_hilite(terminal, x, y);
-		/* Show the cursor. */
-		_vte_terminal_set_pointer_visible(terminal, TRUE);
+		/* Show the cursor if we moved. */
+		if (event->type != GDK_MOTION_NOTIFY ||
+		    x != terminal->pvt->mouse_last_x ||
+		    y != terminal->pvt->mouse_last_y)
+			_vte_terminal_set_pointer_visible(terminal, TRUE);
 	}
 
 	switch (event->type) {
-- 
2.1.0