Theme parsing error: gtk.css:1652:16: '-gtk-icon-size' is not a valid property name

I get this warning since ~ 2 weeks doing a “zypper dup” about every 5 days.

(gvim:3524): Gtk-WARNING **: 07:40:48.503: Theme parsing error: gtk.css:1649:16: '-gtk-icon-size' is not a valid property name

I see this when I start things from the command line and apart from this warning nothing is wrong as far as I can see. Multiple applications trigger this warning, when I start gvim it prints out this message 4 times, when I start Firefox only two times.

$ find / -name gtk.css 2> /dev/null
/home/user/.config/gtk-3.0/gtk.css
/home/user/.config/gtk-4.0/gtk.css
/usr/share/themes/Breeze/gtk-3.0/gtk.css
/usr/share/themes/Breeze/gtk-4.0/gtk.css
/usr/share/themes/Breeze-Dark/gtk-3.0/gtk.css
/usr/share/themes/Breeze-Dark/gtk-4.0/gtk.css
/usr/share/themes/Adwaita/gtk-3.0/gtk.css
/usr/share/themes/Adwaita-dark/gtk-3.0/gtk.css

So multiple gtk.css files but based on the line number I can say the problem is originating in /usr/share/themes/Breeze-Dark/gtk-3.0/gtk.css as that has “-gtk-icon-size: 16px” on line 1659 but I see in in 4 files:

/usr/share/themes/Breeze/gtk-3.0/gtk.css
1649:  -gtk-icon-size: 16px; }
1652:  -gtk-icon-size: 32px; }

/usr/share/themes/Breeze/gtk-4.0/gtk.css
1595:  -gtk-icon-size: 16px; }
1598:  -gtk-icon-size: 32px; }
1601:  -gtk-icon-size: 128px; }
3834:  -gtk-icon-size: 24px;

/usr/share/themes/Breeze-Dark/gtk-3.0/gtk.css
1649:  -gtk-icon-size: 16px; }
1652:  -gtk-icon-size: 32px; }

/usr/share/themes/Breeze-Dark/gtk-4.0/gtk.css
1595:  -gtk-icon-size: 16px; }
1598:  -gtk-icon-size: 32px; }
1601:  -gtk-icon-size: 128px; }
3834:  -gtk-icon-size: 24px;

I am running KDE and never played with GTK themes but looks like these application somehow use GTK themes. I found GTK on the ArchLinux wiki and based on that I tried:

$ GTK_THEME=Adwaita:dark gvim

That works and gvim get a dark header.

$ sudo rpm -q --whatprovides /usr/share/themes/Breeze-Dark/gtk-3.0/gtk.css
gtk3-metatheme-breeze-5.27.4-2.1.noarch

Clear, I tried “zypper remove” for this (and the gtk4 variant) and saw there were no dependencies so went ahead. After that the problem is gone.

So problem gone, but some questions:

  1. Good idea to post this although the problem is gone?
  2. Would you have done something different?
2 Likes

I’ve always believed it’s a good idea to post about an issue and to detail the solution. This helps folks who experience the same (or similar) issue, to do a search, then work thru the solution. If fixed - great !

Been a software developer for 35+ years and always employ a policy to document all issues (with solution), even simple ones, so that future team members can benefit :+1:

After the update to 20230428 today the problem was back.

So I once more removed the packages but also added a lock:

sudo zypper remove gtk3-metatheme-breeze gtk4-metatheme-breeze
sudo zypper addlock gtk3-metatheme-breeze gtk4-metatheme-breeze
1 Like

Are you finding any error or warnings in any log files ?

No, no errors or warnings related to this apart from what I expect to see:

Apr 29 17:32:53 [RPM][27816]: install gtk3-metatheme-breeze-5.27.4-2.1.noarch: success
Apr 29 17:32:53 [RPM][27816]: install gtk3-metatheme-breeze-5.27.4-2.1.noarch: success
Apr 29 17:40:46 firefox[7324]: Theme parsing error: gtk.css:1649:16: ‘-gtk-icon-size’ is not a valid property name
Apr 29 17:40:46 firefox[7324]: Theme parsing error: gtk.css:1652:16: ‘-gtk-icon-size’ is not a valid property name
Apr 29 17:40:46 firefox[7324]: Theme parsing error: gtk.css:1649:16: ‘-gtk-icon-size’ is not a valid property name
Apr 29 17:40:46 firefox[7324]: Theme parsing error: gtk.css:1652:16: ‘-gtk-icon-size’ is not a valid property name
Apr 29 23:42:36 sudo[24419]: user : TTY=pts/4 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/zypper rm gtk3-metatheme-breeze-5.27.4-2.1.noarch
Apr 29 23:42:41 linux-d7n9 [RPM][24448]: erase gtk3-metatheme-breeze-5.27.4-2.1.noarch: success

Try creating /usr/local/share/themes/*/gtk-3.0/gtk.css files and/or /etc/gtk-?.0/gtk.css files that exclude those bad lines.

My TWs have gtk4* locked out. None include any session type in any way related to Gnome or its derivatives, so nothing installed depends on gtk4.

# cat /usr/local/bin/zypsei
#!/bin/sh
zypper --no-refresh se -s -i $*  | grep -Ev 'debug|devel|srcp|openSUSE-20' | grep -E 'x86|noarch'| sort
# zypsei metatheme
i  | metatheme-breeze-common  | package | 5.27.4-2.1 | x86_64 | OSS
i+ | gtk2-metatheme-adwaita   | package | 3.28-1.21  | noarch | OSS
i+ | gtk3-metatheme-adwaita   | package | 3.28-1.21  | noarch | OSS
i+ | metatheme-adwaita-common | package | 3.28-1.21  | noarch | OSS

My output after removing these two packages again:

S | Name                     | Type    | Version    | Arch   | Repository
--+--------------------------+---------+------------+--------+-----------
i | gtk2-metatheme-adwaita   | package | 3.28-1.21  | noarch | repo-oss
i | gtk2-metatheme-breeze    | package | 5.27.4-2.1 | noarch | repo-oss
i | gtk3-metatheme-adwaita   | package | 3.28-1.21  | noarch | repo-oss
i | metatheme-adwaita-common | package | 3.28-1.21  | noarch | repo-oss
i | metatheme-breeze-common  | package | 5.27.4-2.1 | x86_64 | repo-oss

So I have only gtk2-metatheme-breeze extra. I did not lock out gtk4* (yet).

Thanks for the suggestion on creating local overrides for these themes but I thin locking them out is even better, I did at least not see any drawback yet.

JFYI: The issue is fixed for KDE Plasma 5.27.5 (commit 49a595aa)

1 Like