ubuntu / yaru

All Ubuntu Yaru GNOME themes
https://community.ubuntu.com/c/desktop/theme-refresh
GNU General Public License v3.0
1.36k stars 186 forks source link

pasystray volume icon is not being displayed properly #1289

Closed Alex-Gorny closed 5 years ago

Alex-Gorny commented 5 years ago

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

Alex-Gorny commented 5 years ago

Additional information:

clobrano commented 5 years ago

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?

Alex-Gorny commented 5 years ago

@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

Alex-Gorny commented 5 years ago

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

Alex-Gorny commented 5 years ago

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.

clobrano commented 5 years ago

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
Alex-Gorny commented 5 years ago
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
clobrano commented 5 years ago

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.

Alex-Gorny commented 5 years ago

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

Alex-Gorny commented 5 years ago

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.

Alex-Gorny commented 5 years ago

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

clobrano commented 5 years ago

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.

Alex-Gorny commented 5 years ago

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

clobrano commented 5 years ago

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.

Alex-Gorny commented 5 years ago

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

clobrano commented 5 years ago

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

Alex-Gorny commented 5 years ago

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.

clobrano commented 5 years ago

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.

Alex-Gorny commented 5 years ago

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.

clobrano commented 5 years ago

nice catch! Thank you for looking for it.

closing this now