Yaru: pasystray volume icon is not being displayed properly

Created on 24 Mar 2019  ·  20Comments  ·  Source: ubuntu/yaru

Expected Behavior

audio-volume-low-symbolic.svg
audio-volume-medium-symbolic.svg
audio-volume-high-symbolic.svg
These 3 icons should not be displayed in black color.

Actual Behavior

pasystray GtkStatusIcon is not being displayed properly.
It is being displayed in black color in Yaru theme.

Steps to Reproduce the Problem

  1. Install Gentoo Linux.
  2. Install gtk+ 3.24.7, awesome WM 4.3, and pasystray 0.7.1.

Specifications

`$ git describe`

r29-53-g6a4d9874

2019-03-24-122658_306x70_escrotum

Most helpful comment

I think I've found the root cause of the issue:
https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html#gtk-status-icon-set-from-icon-name

gtk_status_icon_set_from_icon_name has been deprecated since version 3.14 and should not be used

So it is a pasystray issue. pasystray uses deprecated API.

All 20 comments

Hi @Alex-Gorny, thanks for taking time to report this.

You reported the problem on gtk upstream as well, does this mean the issue is reproducible on Adwaita as well?

@clobrano
Now I re-checked it. This issue cannot be reproduced when using Adwaita icon theme.
Here is the screenshot with Adwaita theme:
2019-03-24-145032_291x212_escrotum

So now I think that it is a Yaru theme issue only.
These 4 icons are invalid in Yaru but are valid in Adwaita:

audio-volume-muted
audio-volume-low
audio-volume-medium
audio-volume-high

https://github.com/christophgysin/pasystray/blob/master/src/ui.c#L70

I've tested "Humanity" GTKv3 icon theme. All works fine:

2019-03-25-095615_274x104_escrotum

So I think it is a "Yaru" GTKv3 icon theme bug only.

could you try the following comands and report the output?

gsettings get org.gnome.desktop.interface icon-theme
gsettings get org.gnome.desktop.interface gtk-theme
xxx@yyy /tmp $ gsettings get org.gnome.desktop.interface icon-theme
'Adwaita'
xxx@yyy /tmp $ gsettings get org.gnome.desktop.interface gtk-theme
'Adwaita'
xxx@yyy /tmp $

However, all the applications except pasystray now are displayed using "Yaru" themes, and all is correct. Additionally, here are my config files:

/etc/gtk-2.0/gtkrc

gtk-cursor-theme-name = "Yaru"
gtk-cursor-theme-size = 24
gtk-font-name = "Ubuntu 11"
gtk-icon-theme-name = "Yaru"
gtk-theme-name = "Yaru"

/etc/gtk-3.0/settings.ini

[Settings]
gtk-cursor-theme-name = Yaru
gtk-cursor-theme-size = 24
gtk-font-name = Ubuntu 11
gtk-icon-theme-name = Yaru
gtk-theme-name = Yaru

Probably the gtk part of Yaru is working, but the gnome-shell one is not correctly installed/working. Consider that, on Ubuntu, Yaru is supported by the ubuntu gnome-shell session, which is probably not running on your system. In this condition, you can expect the gtk part to work, but not the shell

EDIT: do you have gnome shell extension "use custom theme" installed as well? Not sure it would make any difference, but it worths a try.

I have no gnome shell installed on my computer. I use Gentoo Linux, awesome WM and Yaru theme. Several months ago I used Yaru theme too, and all the icons had been displayed properly. But now all the icons in Yaru are being displayed properly except these 4 icons:

audio-volume-muted
audio-volume-low
audio-volume-medium
audio-volume-high

Please look at my current screenshot.

2019-03-26-124645_1674x1183_escrotum

All the icons are fine except audio-volume-high.
audio-volume-high is suddenly black.

My temporary workaround:

cp /usr/share/icons/Tango/32x32/status/audio-volume-muted.png /usr/share/icons/Yaru/32x32/status
cp /usr/share/icons/Tango/32x32/status/audio-volume-low.png /usr/share/icons/Yaru/32x32/status
cp /usr/share/icons/Tango/32x32/status/audio-volume-medium.png /usr/share/icons/Yaru/32x32/status
cp /usr/share/icons/Tango/32x32/status/audio-volume-high.png /usr/share/icons/Yaru/32x32/status

Now all works fine:
2019-03-26-130900_285x52_escrotum

So now I think that it is a Yaru theme issue only.
These 4 icons are invalid in Yaru but are valid in Adwaita:

audio-volume-muted audio-volume-low audio-volume-medium audio-volume-high

https://github.com/christophgysin/pasystray/blob/master/src/ui.c#L70

The icons are not invalid, but for some reason they are black.
Gnome shell can change the color of the icon, and in fact even if the icons are black, they appear white in gnome. Are you sure pasystray supports that?

The other examples use colorful icons, so it doesn't really mean that they are working fine.

Are you sure pasystray supports that?

I don't know.

I have a question. I see that audio-volume-high.png is absent here:
https://github.com/ubuntu/yaru/tree/master/icons/Suru/32x32/status
Is it OK?

Probably pasystray cannot process SVG icons but can process PNG icons.
So I executed:

rsvg-convert -h 32 -w 32 /usr/share/icons/Yaru/scalable/status/audio-volume-high-symbolic.svg > /usr/share/icons/Yaru/32x32/status/audio-volume-high.png

Now the icon is grey:
2019-03-26-210018_265x76_escrotum

Right, that's what I intended for icon inheritance. Yaru does not have that icons, so your system should look for them in adwaita or hi color.

Right, that's what I intended for icon inheritance

I debugged pasystray using strace. This inheritance order does not work properly. pasystray checks /usr/share/icons/Yaru/scalable/status/audio-volume-high-symbolic.svg just after launch. Then it reads its SVG content and renders it in the system tray. The rendered icon is black. But if I remove these icons then the inheritance order works properly (the icon is not black).

rm /usr/share/icons/Yaru/scalable/status/audio-volume-{high,low,medium,muted}-symbolic.svg

2019-03-26-225340_274x68_escrotum

Great idea using strace. To me it seems correct, the icon is provided, so it's used. As said the icon as svg can be colored according to the panel color, maybe pasystray doesn't or can't do it

So if I do not execute
rm /usr/share/icons/Yaru/scalable/status/audio-volume-{high,low,medium,muted}-symbolic.svg
then the icon is black. I debugged it. In this line, gtk_icon_theme_has_icon() returns TRUE:

https://github.com/christophgysin/pasystray/blob/master/src/systray_impl.c#L143

https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-has-icon

So GTKv3 thinks that audio-volume-high icon exists for Yaru theme. But actually its PNG file does not exist:

$ find /usr/share/icons/Yaru -iname *audio-volume-high*
/usr/share/icons/Yaru/scalable/status/audio-volume-high-symbolic.svg

I think it can be either GTKv3 bug or Yaru theme bug.
If it is GTkv3 bug then gtk_icon_theme_has_icon() should return FALSE if scalable SVG exists but PNG files do not exist.
If it is Yaru theme bug then Yaru theme should either contain both SVG and 32x32 PNG or do not contain SVG at all.

The icon is available, why should it return false?
Gnome project is moving towards svg only icons so it makes perfectly sense to me, and in fact all symbolic icons are now distributed as svg only.

I think I've found the root cause of the issue:
https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html#gtk-status-icon-set-from-icon-name

gtk_status_icon_set_from_icon_name has been deprecated since version 3.14 and should not be used

So it is a pasystray issue. pasystray uses deprecated API.

nice catch! Thank you for looking for it.

closing this now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewpaulthomas picture matthewpaulthomas  ·  3Comments

8none1 picture 8none1  ·  3Comments

madsrh picture madsrh  ·  3Comments

Feichtmeier picture Feichtmeier  ·  3Comments

matthewpaulthomas picture matthewpaulthomas  ·  3Comments