diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-11-15 09:34:25 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-11-15 10:54:36 -0500 |
commit | b30715da6a6436fd4fd89c4aa25cc961112f5579 (patch) | |
tree | 34947dd9534bb693272ee29cb3598137bb84d596 /gtk/gtktooltip.c | |
parent | dd0a854bbb1c20b33327df262afee15b3b110a47 (diff) | |
download | gtk+-b30715da6a6436fd4fd89c4aa25cc961112f5579.tar.gz |
Fix tooltip triggeringfix-tooltip-trigger
Ever since 5b5d2665d373c35f, tooltips don't work properly,
since we get more motion events now, and those keep the
tooltips from appearing. This can be seen e.g. on the icon
in the password entry in widget-factory, or on the section
switcher buttons in the Emoji chooser.
Ignore synthetic motion events for the purposes of
determining whether the user moved the mouse.
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r-- | gtk/gtktooltip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 73c54cd6b0..392bd0620e 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -917,6 +917,11 @@ _gtk_tooltip_handle_event (GtkWidget *target, surface = gdk_event_get_surface (event); gdk_event_get_position (event, &x, &y); + /* ignore synthetic motion events */ + if (event_type == GDK_MOTION_NOTIFY && + gdk_event_get_time (event) == GDK_CURRENT_TIME) + return; + gtk_native_get_surface_transform (native, &nx, &ny); gtk_widget_translate_coordinates (GTK_WIDGET (native), target, x - nx, y - ny, &x, &y); gtk_tooltip_handle_event_internal (event_type, surface, target, x, y); |