text: Ignore synthetic motion events

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
This commit is contained in:
Matthias Clasen
2021-03-25 15:25:35 -04:00
parent 7aed044cb6
commit 7cd7e781e2
2 changed files with 11 additions and 0 deletions

View File

@@ -2940,6 +2940,11 @@ gtk_text_motion_controller_motion (GtkEventControllerMotion *controller,
GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GdkEvent *event;
event = gtk_event_controller_get_current_event (GTK_EVENT_CONTROLLER (controller));
if (gdk_motion_event_is_synthetic (event))
return;
if (priv->mouse_cursor_obscured)
{

View File

@@ -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));
}