[gtk+] Don't emit ::query-tooltip by name



commit 12dfb368e29bb58b4313b578f0ce75cfc8ead9a1
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 6 09:54:24 2016 -0400

    Don't emit ::query-tooltip by name
    
    This signal is emitted quite a bit, and we can easily avoid it.

 gtk/gtktooltip.c       |    7 +------
 gtk/gtkwidget.c        |   19 +++++++++++++++++++
 gtk/gtkwidgetprivate.h |    6 ++++++
 3 files changed, 26 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index be13d5f..218345f 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -824,12 +824,7 @@ gtk_tooltip_run_requery (GtkWidget  **widget,
       has_tooltip = gtk_widget_get_has_tooltip (*widget);
 
       if (has_tooltip)
-       g_signal_emit_by_name (*widget,
-                              "query-tooltip",
-                              *x, *y,
-                              tooltip->keyboard_mode_enabled,
-                              tooltip,
-                              &return_value);
+        return_value = gtk_widget_query_tooltip (widget, *x, *y, tooltip->keyboard_mode_enabled, tooltip);
 
       if (!return_value)
         {
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index eb86856..473dc5b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8093,6 +8093,25 @@ gtk_widget_real_query_tooltip (GtkWidget  *widget,
   return FALSE;
 }
 
+gboolean
+gtk_widget_query_tooltip (GtkWidget  *widget,
+                          gint        x,
+                          gint        y,
+                          gboolean    keyboard_mode,
+                          GtkTooltip *tooltip)
+{
+  gboolean retval = FALSE;
+
+  g_signal_emit (widget,
+                 widget_signals[QUERY_TOOLTIP],
+                 x, y,
+                 keyboard_mode,
+                 tooltip,
+                 &retval);
+
+  return retval;
+}
+
 static void
 gtk_widget_real_state_flags_changed (GtkWidget     *widget,
                                      GtkStateFlags  old_state)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 233a2d3..ebee09a 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -297,6 +297,12 @@ gboolean          gtk_widget_has_size_request              (GtkWidget *widget);
 
 void              gtk_widget_reset_controllers             (GtkWidget *widget);
 
+gboolean          gtk_widget_query_tooltip                 (GtkWidget  *widget,
+                                                            gint        x,
+                                                            gint        y,
+                                                            gboolean    keyboard_mode,
+                                                            GtkTooltip *tooltip);
+
 /* inline getters */
 
 static inline gboolean


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