Closed Alex-Gorny closed 5 years ago
Additional information:
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:
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:
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.
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:
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:
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
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
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
Specifications
r29-53-g6a4d9874