diff --git a/ChangeLog b/ChangeLog index c61fde3122..879ecef398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-19 Matthias Clasen + + * gtk/gtktreeview.c (gtk_tree_view_set_tooltip_column): + Only connect/disconnect signals when necessary, emit + change notification. + 2007-07-19 Kristian Rietveld * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 42fa6f25ce..239565a314 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -15429,21 +15429,28 @@ gtk_tree_view_set_tooltip_column (GtkTreeView *tree_view, { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); + if (column == tree_view->priv->tooltip_column) + return; + if (column == -1) { g_signal_handlers_disconnect_by_func (tree_view, - gtk_tree_view_set_tooltip_query_cb, + gtk_tree_view_set_tooltip_query_cb, NULL); gtk_widget_set_has_tooltip (GTK_WIDGET (tree_view), FALSE); } else { - g_signal_connect (tree_view, "query-tooltip", - G_CALLBACK (gtk_tree_view_set_tooltip_query_cb), NULL); - gtk_widget_set_has_tooltip (GTK_WIDGET (tree_view), TRUE); + if (tree_view->priv->tooltip_column == -1) + { + g_signal_connect (tree_view, "query-tooltip", + G_CALLBACK (gtk_tree_view_set_tooltip_query_cb), NULL); + gtk_widget_set_has_tooltip (GTK_WIDGET (tree_view), TRUE); + } } tree_view->priv->tooltip_column = column; + g_object_notify (G_OBJECT (tree_view), "tooltip-column"); } /**