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 679592 - Setting _NET_SYSTEM_TRAY_COLORS atom does not update the icon
Setting _NET_SYSTEM_TRAY_COLORS atom does not update the icon
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-08 17:49 UTC by Vincent Bernat
Modified: 2018-02-10 03:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent Bernat 2012-07-08 17:49:52 UTC
Hi!

When using the following command, the icon in the systray is not updated:

 xprop -id 0xc00002 -format _NET_SYSTEM_TRAY_COLORS 32c -set _NET_SYSTEM_TRAY_COLORS 65535,65535,65535,65535,8670,8670,65535,32385,0,8670,65535,8670

If I restart the applet (by just killing it and relaunching it), the appropriate color is correctly applied. Therefore, the syntax of my atom is correct.

The applet is "bluetooth-applet". I have run the applet into gdb and icon->priv->fg_color (in gtktrayicon-x11.c) is correctly updated upon reception of the new atom value. I am not familiar with GTK but it seems there is no redraw of the icon. Maybe it can be triggered in some other way but it is not obvious to me. Updating the atom should change the icon right away.
Comment 1 Matthias Clasen 2012-07-11 11:08:20 UTC
Looks like we should perhaps call gtk_status_icon_update_image in
gtk_status_icon_fg_changed and gtk_status_icon_color_changed.

Can you test if that fixes your problem ?
Comment 2 Vincent Bernat 2012-07-13 22:08:46 UTC
No, it does not fix the problem. I have traced with gdb and `gtk_status_icon_update_image` ends to be called correctly. Inside, `gtk_image_set_from_pixbuf` is called. If trace the call to `gtk_status_icon_update_image` from a call of `gtk_status_icon_set_from_gicon`, I don't see any difference. However, I notice that the new icon is not painted until I quit `gtk_status_icon_update_image`. I don't know what function is responsible for this function to be painted.

I have also noticed that alpha channel was set to some random value. I have forced it to be 1 without any change.

I noticed that there was a difference between `gtk_status_icon_fg_changed` and `gtk_status_icon_color_changed`. On the first, `rgba` is a pointer to `GdkRGBA`. On the second, `rgba` is an allocation of `GdkRGBA` on the stack. In both cases, the actual value is retrieved with `g_object_get(priv->tray_icon, ..., &rgba, NULL)` and they seem declared in the same way (with `g_object_class_install_property` in `gtktrayicon-x11.c`?)

Is that legit?
Comment 3 Matthias Clasen 2018-02-10 03:36:56 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.