GNOME Bugzilla – Bug 679592
Setting _NET_SYSTEM_TRAY_COLORS atom does not update the icon
Last modified: 2018-02-10 03:36:56 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.
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 ?
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?
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.