[gtk+] Make gtk_tooltip_trigger_tooltip_query work again



commit 321ddb8697a22cbff67979de9e838b5233c546de
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 5 21:47:16 2016 -0400

    Make gtk_tooltip_trigger_tooltip_query work again
    
    This was broken ever since we started looking at the
    source device of the event.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674215

 gtk/gtktooltip.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 12a7b35..e0672ae 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -149,6 +149,8 @@ static void       gtk_tooltip_display_closed       (GdkDisplay      *display,
 static void       gtk_tooltip_set_last_window      (GtkTooltip      *tooltip,
                                                    GdkWindow       *window);
 
+static void       gtk_tooltip_handle_event_internal (GdkEvent        *event);
+
 static inline GQuark tooltip_quark (void)
 {
   static GQuark quark;
@@ -460,7 +462,7 @@ gtk_tooltip_trigger_tooltip_query (GdkDisplay *display)
   event.motion.x_root = x;
   event.motion.y_root = y;
 
-  _gtk_tooltip_handle_event (&event);
+  gtk_tooltip_handle_event_internal (&event);
 }
 
 /* private functions */
@@ -1405,15 +1407,21 @@ tooltips_enabled (GdkEvent *event)
 void
 _gtk_tooltip_handle_event (GdkEvent *event)
 {
+  if (!tooltips_enabled (event))
+    return;
+
+  gtk_tooltip_handle_event_internal (event);
+}
+
+static void
+gtk_tooltip_handle_event_internal (GdkEvent *event)
+{
   gint x, y;
   gboolean return_value = FALSE;
   GtkWidget *has_tooltip_widget = NULL;
   GdkDisplay *display;
   GtkTooltip *current_tooltip;
 
-  if (!tooltips_enabled (event))
-    return;
-
   /* Returns coordinates relative to has_tooltip_widget's allocation. */
   has_tooltip_widget = find_topmost_widget_coords_from_event (event, &x, &y);
   display = gdk_window_get_display (event->any.window);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]