[gtk/fix-tooltip-trigger: 1596/1596] Fix tooltip triggering
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-tooltip-trigger: 1596/1596] Fix tooltip triggering
- Date: Sun, 15 Nov 2020 14:43:41 +0000 (UTC)
commit ce4d63acd4f4f2cde10d59f866ef5160cad75f95
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Nov 15 09:34:25 2020 -0500
Fix tooltip triggering
Ever since 5b5d2665d373c35f, tooltips don't work properly,
since we get more motion events now, and those keep the
tooltips from appearing.
Ignore synthetic motion events for the purposes of
determining whether the user moved the mouse.
gtk/gtktooltip.c | 5 +++++
1 file changed, 5 insertions(+)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]