GNOME Bugzilla – Bug 641060
Use proper colors for trayicons with symbolic icons
Last modified: 2011-02-07 18:59:20 UTC
The GtkStatusIcon side of the symbolic-trayicon-colors patch got committed long ago (although it has a few bugs, bug 640159). The gnome-panel side has been attached to bug 614711, but not committed. This adds the patch from there, and then sets the colors appropriately from the theme. This, eg, makes the gpk-update-icon display white-on-transparent rather than black-on-transparent in the mostly-black message tray. (Yes, Jon, I know. The patch is still correct as long as we support trayicons in the message tray at all.) It would also fix NM, if NM requested symbolic icons. Using panel.actor to get the symbolic colors is probably wrong, and I should probably have added "color: white" to messageTray.actor's CSS and then used that instead. So pretend I did that.
Created attachment 179733 [details] [review] tray: add _NET_SYSTEM_TRAY_COLORS support, for symbolic icons
Created attachment 179734 [details] [review] tray: fix so that trayicons using symbolic icons get the right colors The tray protocol only allows setting a single set of colors for all symbolic trayicons. We semi-arbitrarily use panel.actor as the actor whose colors we track.
Review of attachment 179733 [details] [review]: One minor thing ::: src/tray/na-tray-manager.c @@ +663,3 @@ + + if (!manager->invisible) + return; This doesn't quite make sense to me - either you need to g_return_if_fail() if na_tray_manager_set_colors() is called before na_tray_manager_manage_screen() or you need to have this and then also call na_tray_manager_set_colors_property() after managing a screen.
Review of attachment 179734 [details] [review]: ::: src/shell-tray-manager.c @@ +205,3 @@ + icon_colors = st_theme_node_get_icon_colors (theme_node); + + foreground.red = (icon_colors->foreground.red << 8) | icon_colors->foreground.red; OK like this, but I think I would have just written '* 257' (or * 0x101 if you like a visual representation of duplicating hex digits)
Created attachment 179828 [details] [review] tray: re-sync from panel, including _NET_SYSTEM_TRAY_COLORS support This is a re-sync from gnome-panel after committing the 3 new patches in bug 614711. (The parts that don't appear in any of those patches are the random differences in gtk3 porting between panel and shell.)
Review of attachment 179828 [details] [review]: Just one problem I see ::: src/tray/na-tray-child.c @@ +55,3 @@ /* Set a transparent background */ + GdkColor transparent = { 0, 0, 0, 0 }; /* only pixel=0 matters */ + gdk_window_set_background (window, &transparent); This doesn't work - gdk_window_set_background() doesn't pay attention to the pixel value in GdkColor any more
reverted that part of the re-sync patch (and attached an equivalent anti-patch to the gnome-panel bug) Attachment 179734 [details] pushed as bd04107 - tray: fix so that trayicons using symbolic icons get the right colors Attachment 179828 [details] pushed as e208c7e - tray: re-sync from panel, including _NET_SYSTEM_TRAY_COLORS support
*** Bug 631194 has been marked as a duplicate of this bug. ***