After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 455482 - remove old tooltips work-around from uimanager
remove old tooltips work-around from uimanager
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-07-10 09:43 UTC by Christian Persch
Modified: 2007-07-10 18:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (1.35 KB, patch)
2007-07-10 09:46 UTC, Christian Persch
none Details | Review
updated patch: don't use gtk_tool_item_set_tooltip_text on non-toolitems (1.71 KB, patch)
2007-07-10 11:38 UTC, Christian Persch
accepted-commit_now Details | Review

Description Christian Persch 2007-07-10 09:43:40 UTC
GtkUIManager/GtkAction has some work-around for the old tooltip code not being able to set tooltips on toolitems not in a toolbar; this is obsolete with the new tooltips code.
Comment 1 Christian Persch 2007-07-10 09:46:16 UTC
Created attachment 91533 [details] [review]
fix
Comment 2 Kristian Rietveld 2007-07-10 11:26:24 UTC
The first chunk looks right to me.

>Index: gtk/gtkaction.c
>===================================================================
>--- gtk/gtkaction.c	(révision 18431)
>+++ gtk/gtkaction.c	(copie de travail)
>@@ -1451,13 +1444,8 @@ static void 
> gtk_action_sync_tooltip (GtkAction *action,
> 			 GtkWidget *proxy)
> {
>-  GtkWidget *parent;
>-
>-  parent = gtk_widget_get_parent (proxy);
>-  
>-  if (GTK_IS_TOOL_ITEM (proxy) && GTK_IS_TOOLBAR (parent))
>-    gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (proxy),
>-				    action->private_data->tooltip);
>+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (proxy),
>+				  action->private_data->tooltip);


I don't see why this has to be changed.  Doesn't this code currently guard against tooltips being set on menu items, and in general all items except toolbar items?
Comment 3 Christian Persch 2007-07-10 11:37:37 UTC
(In reply to comment #2)
> >-  if (GTK_IS_TOOL_ITEM (proxy) && GTK_IS_TOOLBAR (parent))
> >-    gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (proxy),
> >-				    action->private_data->tooltip);
> >+  gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (proxy),
> >+				  action->private_data->tooltip);
> 
> 
> I don't see why this has to be changed.  Doesn't this code currently guard
> against tooltips being set on menu items, and in general all items except
> toolbar items?

The problematic part was the |GTK_IS_TOOLBAR (parent)| check. But you're right that the patch applied the tooltip incorrectly to !tool-item objects; attached updated patch corrects this by protecting the another caller of gtk_action_sync_tooltip with GTK_IS_TOOL_ITEM (proxy); the one other caller is already calling it only in this condition.

Comment 4 Christian Persch 2007-07-10 11:38:16 UTC
Created attachment 91543 [details] [review]
updated patch: don't use gtk_tool_item_set_tooltip_text on non-toolitems
Comment 5 Matthias Clasen 2007-07-10 13:49:02 UTC
Looks good to me. Thanks for cleaning that up.
Comment 6 Christian Persch 2007-07-10 18:01:32 UTC
        * gtk/gtkaction.c: (gtk_action_sync_tooltip),
        (gtk_action_set_tooltip):
        * gtk/gtkuimanager.c: (update_node): Remove work-around for the old
        tooltips code, and just set the action tooltip immediately on the
        proxy widget. Bug #455482.