#1054168 adwaita-icon-theme: Legacy icons edit-clear and window-close break applications

#1054168#5
Date:
2023-10-18 15:24:28 UTC
From:
To:
Dear Maintainer,

Some legacy icons are distributed in only a subset of sizes, whereas
there is a symbolic version with all sizes.  Unfortunately, GTK's
symbolic fallback will not kick in if the icon exists non-symbolic at
any size, leading to weird broken UI for applications using those.

Namely, Geany still uses GTK_STOCK_CLEAR ("edit-clear" icon) and
GTK_STOCK_CLOSE ("window-close" icon), and Adwaita (v43) only has sizes
48 for the former, and 24 and 48 for the latter.  This leads to a silly
UI wasting lots of screen estate.

Yes, Geany could be updated to use the symbolic icons, and upstream
will probably do so in the future, but it's unlikely it is the only app
affected.  Moreover, it's unnoticeable with most other themes, that
don't show the issue.

Adwaita 45.0 currently in testing/unstable does not have them anymore,
fixing the issue as GTK will fall back on the symbolic icons, which are
available at reasonable sizes.  However, this doesn't fix apps in
stable.

File list from 43:

$ find /usr/share/icons/Adwaita/ -name window-close.png -o -name edit-clear.png
/usr/share/icons/Adwaita/48x48/legacy/window-close.png
/usr/share/icons/Adwaita/48x48/legacy/edit-clear.png
/usr/share/icons/Adwaita/24x24/legacy/window-close.png

Note that removing/moving those away and updating the icon cache fixes
the issue for Geany.  Maybe other icons affect other apps however.

It could be interesting to review the sizes in which icons are
distributed, as it might have similar effect if only a subset of sizes
is available (esp. if 16 or 24 is missing).

Attached Python program shows the behavior when used in a button and in
an entry, in three variants: GtkStock API, icon-name and
symbolic-icon-name.  You can easily see that they get better in that
order; and if you remove the offending icons from the theme, they all
magically work nicely.

I think this should be considered for Bookworm as it affects standard
installation of regular packages (GNOME + Geany, and possibly others).

Regards,
Colomban


PS: admittedly, I'm not entirely neutral in the matter, being a Geany
developer.  But still :)