Don't emit ::query-tooltip by name

This signal is emitted quite a bit, and we can easily avoid it.
This commit is contained in:
Matthias Clasen 2016-05-06 09:54:24 -04:00
parent 64710def82
commit 12dfb368e2
3 changed files with 26 additions and 6 deletions

View File

@ -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)
{

View File

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

View File

@ -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