ubuntu / yaru

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

Yaru 24.10.4's GTK4 theme is incompatible with Ubuntu 24.04's GTK #4148

Closed jhenstridge closed 1 week ago

jhenstridge commented 1 week ago

We've been preparing a new release of the gtk-common-themes snap that ships the most recent Yaru release in order to support the new accent colours shipped with Ubuntu 24.10. This means that the theme is being used with slightly older versions of GTK than would be seen outside of the snap sandbox.

Expected Behavior

Yaru should work with GTK 4.14.4, as shipped in the gnome-46-2404 snap.

Actual Behavior

The application spits out a bunch of warnings like:

(pingpath:653849): Gtk-WARNING **: 16:26:25.569: Theme parser error: gtk.css:1954:16-20: Expected a number

and some colours are not applied.

Steps to Reproduce the Problem

  1. Switch to the candidate channel of gtk-common-themes with sudo snap refresh --candidate gtk-common-themes
  2. Install a snap that uses GTK 4 such as pingpath
  3. Run the snap
  4. See the stream of warnings while parsing the CSS.

Software that presents the issue

The pingpath snap exhibits the problem.

Yaru version

Yaru 24.10.4 as shipped in revision 1537 of the gtk-common-themes snap, which is currently published to the candidate channel.

Possible fixes

The problem appears to be the use of CSS relative colors in 86549dd1, which requires GTK >= 4.15.2 (released on 28th June). It looks like the older alpha() and shade() functions continue to work in current GTK releases, so reverting that commit might be enough.

Alternatively, the new accent colours could be back-ported to Yaru 24.04, and we ship that in gtk-common-themes. That might be the easier option if you don't want to deal with old GTK version compatibility.

3v1n0 commented 1 week ago

I think it's still better to revert just that commit since otherwise we'd miss various other fixes around.

However i feel it's more a snap issue than yaru, as I think yaru should still track upstream content while the snap can handle the retro-incompatibilities.

Also this is another good reason why gtk-common-themes should be versioned (depending on the core one is targetting).

soumyaDghosh commented 1 week ago

Also this is another good reason why gtk-common-themes should be versioned (depending on the core one is targetting).

+1 on this

jhenstridge commented 1 week ago

Also this is another good reason why gtk-common-themes should be versioned (depending on the core one is targetting).

I'm not sure how that would help. If we could build the content snap once and abandon it, that might work. But if new releases add new accent colours, we would need to go back and add them to the old content snap in order for snapped applications to be themed correctly.

If we need to update all those snaps on essentially the same schedule, it's not clear having separate snaps will simplify things.

I do agree that Yaru should be able to evolve with new Ubuntu releases. The best option might be to build two versions of Yaru and ship the GTK4 theme from the old release alongside the GTK4 theme from the new one: e.g. share/themes/Yaru/gtk-4.15 for the new one and share/themes/Yaru/gtk-4.0 for the old one. GTK will pick the newest version less than or equal to its version number.

On the Yaru side, this would require:

  1. keep track of the minimum supported GTK version for the theme.
  2. backport new accent colours to the supported LTS releases of the theme.