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 300982 - fix handling of tooltips in gtkaction.c
fix handling of tooltips in gtkaction.c
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-04-17 17:26 UTC by Sven Neumann
Modified: 2005-04-29 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch against gtk-2-6 (2.47 KB, patch)
2005-04-17 17:27 UTC, Sven Neumann
accepted-commit_now Details | Review

Description Sven Neumann 2005-04-17 17:26:01 UTC
gtkaction.c has two prominent FIXMEs dealing with tooltips on tool-items. I
think this can be easily fixed and will attach a small patch.

What the patch does it to check if the proxy widget has already been added to a
toolbar at the point the action is connected to it. It then sets the tooltip. At
the moment, tooltips would only show up if gtk_action_connect_proxy() is called
before gtk_toolbar_insert().

The patch is simple because gtk_action_sync_tooltip() already checks if the
parent widget is a toolbar so it should be safe to call it here.

The patch also changes a few lines in gtkuimanager.c where an object
notification is done the hard way instead of simply using g_object_notify().
Comment 1 Sven Neumann 2005-04-17 17:27:40 UTC
Created attachment 45363 [details] [review]
patch against gtk-2-6
Comment 2 Sven Neumann 2005-04-18 12:08:36 UTC
I have to correct myself; comment #1 is not entirely correct. At the moment, if
one creates a toolitem manually, inserts it into a toolbar and connects it to an
action, no tooltip will be set. With this patch, the behaviour is improved so
that tooltips will be set if the action is connected after the item is inserted
into the toolbar.

There will still be no tooltips if the item is first connected to an action,
then inserted. The workaround for this problem is to call g_object_notify
(action, "tooltip") after inserting the item to the toolbar. This is what
GtkUIManager is doing. Perhaps this should be documented somewhere.

Comment 3 Sven Neumann 2005-04-28 20:15:52 UTC
This bug-report has a very simple patch attached to it and I tried my best to
explain it. Any particular reason why there has been no comment yet? At least
the small change to gtkuimanager.c should IMO be committed as soon as possible.
Comment 4 Matthias Clasen 2005-04-28 20:35:07 UTC
Looks fine to me. Can you commit it to both branches ?
Comment 5 Matthias Clasen 2005-04-29 16:32:00 UTC
2005-04-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (update_node): Use g_object_notify() instead
	of triggering a ::notify by re-setting the property.  (#300982,
	Sven Neumann)

	* gtk/gtkaction.c (connect_proxy): Use gtk_action_sync_tooltip().