summaryrefslogtreecommitdiff
path: root/gtk/gtktextview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-25 15:25:35 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-25 15:25:35 -0400
commit7cd7e781e21d40ea0ae8e0891faabf6ead7bbbf1 (patch)
tree8842fb6286044e910d7f70a1f7bd93d85e803d43 /gtk/gtktextview.c
parent7aed044cb6f8ec2f1f028cdafd8691c47056d582 (diff)
downloadgtk+-fix-cursor-hiding.tar.gz
text: Ignore synthetic motion eventsfix-cursor-hiding
We want to re-show the obscured mouse cursor when the user interacts with the mouse, not when the pointer position relative to the widget changed. So, ignore synthetic motion events. Fixes: #3792
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r--gtk/gtktextview.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 13b0e67752..7580f20493 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5712,6 +5712,12 @@ gtk_text_view_motion (GtkEventController *controller,
double y,
gpointer user_data)
{
+ GdkEvent *event;
+
+ event = gtk_event_controller_get_current_event (GTK_EVENT_CONTROLLER (controller));
+ if (gdk_motion_event_is_synthetic (event))
+ return;
+
gtk_text_view_unobscure_mouse_cursor (GTK_TEXT_VIEW (user_data));
}