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 638263 - gtk_status_icon_set_name not usable in normal applications
gtk_status_icon_set_name not usable in normal applications
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-12-29 12:46 UTC by Torsten Schoenfeld
Modified: 2011-09-04 21:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Failing program (411 bytes, text/x-csrc)
2010-12-29 12:46 UTC, Torsten Schoenfeld
Details

Description Torsten Schoenfeld 2010-12-29 12:46:07 UTC
Created attachment 177188 [details]
Failing program

It looks like gtk_status_icon_set_name is not usable in a normal application, as the attached program demonstrates.  By the time gtk_status_icon_new() returns, its tray_icon member (on X11) was already shown, and so we get:

(status-icon-name:3730): Gtk-WARNING **: gtk_window_set_wmclass: shouldn't set wmclass after window is realized!

Also:

(status-icon-name:3730): GLib-GObject-WARNING **: g_object_notify: object class `GtkStatusIcon' has no property named `name'

This applies to gtk+ 2.23 and 2.91.
Comment 1 Matthias Clasen 2011-08-29 04:22:03 UTC
Should be fixed now.
Comment 2 Torsten Schoenfeld 2011-09-02 20:14:59 UTC
(In reply to comment #1)
> Should be fixed now.

Your commit does fix the realize issue, but the g_object_notify assertion still occurs on gtk-2-24.  Commit 32f6070bc84c9e6f2173fb0b37476435367c7802 fixed that issue on master, but it never got back-ported.

Shall I cherry-pick it?
Comment 3 Matthias Clasen 2011-09-03 00:57:47 UTC
Sure, please do
Comment 4 Torsten Schoenfeld 2011-09-04 21:05:38 UTC
Now done as commit dafc1eda808fcd75f27ae0287f7ead617973828e.