adw-gtk3 icon indicating copy to clipboard operation
adw-gtk3 copied to clipboard

GTK4 Flatpaks don't use adw-gtk3

Open julianfairfax opened this issue 1 year ago • 15 comments

Prerequisites

Checklist to make sure the issue is not on your end

  • [X] I have made sure that I do not have multiple versions of the theme installed. Only one version should be installed in either ~/.local/share/themes or /usr/share/themes or ~/.themes
  • [X] The file ~/.config/gtk-3.0/gtk.css does not exist. (If it does, backup and remove it.)
  • [X] I have logged out and in again.
  • [ ] Dark theme only. I have enabled adw-gtk3-dark in gnome-tweaks AND set the appearance to dark in gnome-control-center
  • [X] The flatpak theme is installed org.gtk.Gtk3theme.adw-gtk3 and org.gtk.Gtk3theme.adw-gtk3-dark
  • [ ] The app I'm having an issue with is an actual GTK3 app and is not coded using another toolkit like GTK2, GTK4, QT, etc.
  • [X] I have created a new user profile without any modifications except adw-gtk3.

Description

Note that the GTK-4 theme is NOT supported in adw-gtk3's issue tracker.

I know, but, it is my understanding that this should work? I don't know what's going on. I have the Flatpak theme installed.

OS and version [e.g Fedora 37]

Debian Trixie

Adw-gtk3 version. Also specify your installation source. [e.g tar.xz, AUR, git main branch]

4.8

GNOME version

44.2

Application name and version (If the issue is with an app.)

No response

julianfairfax avatar Jul 02 '23 18:07 julianfairfax

Any specific apps?

lassekongo83 avatar Jul 03 '23 15:07 lassekongo83

Any specific apps?

Transmission, for example.

julianfairfax avatar Jul 03 '23 15:07 julianfairfax

Looking at /var/lib/flatpak/runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/active/files I'm unable to find the GTK4 theme anywhere.

@dusansimic Is this something that can be fixed?

Note that the GTK4 theme also import CSS files from a different directory. https://github.com/lassekongo83/adw-gtk3/blob/edb11070d409149889de43cfde10dbe8b185d390/gtk/src/adw-gtk3/gtk-4.0/gtk.css#L38

lassekongo83 avatar Jul 04 '23 13:07 lassekongo83

Is this something that can be fixed?

Yes. I haven't realized that GTK4 support has been added. I'll modify the flatpak manifest so it includes the GTK4 theme.

dusansimic avatar Jul 07 '23 11:07 dusansimic

@julianfairfax could you try out patched versions of flatpak packages? You can download them using the following commands.

$ flatpak install --user https://dl.flathub.org/build-repo/34773/org.gtk.Gtk3theme.adw-gtk3.flatpakref
$ flatpak install --user https://dl.flathub.org/build-repo/34772/org.gtk.Gtk3theme.adw-gtk3-dark.flatpakref

dusansimic avatar Jul 09 '23 12:07 dusansimic

@julianfairfax could you try out patched versions of flatpak packages? You can download them using the following commands.

$ flatpak install --user https://dl.flathub.org/build-repo/34773/org.gtk.Gtk3theme.adw-gtk3.flatpakref
$ flatpak install --user https://dl.flathub.org/build-repo/34772/org.gtk.Gtk3theme.adw-gtk3-dark.flatpakref

I can do that earliest on Wednesday, so maybe best to have someone else test before then?

julianfairfax avatar Jul 09 '23 19:07 julianfairfax

This did not work on my end. Transmission from flathub is still not using the GTK4 theme. I also couldn't find the new install location for the updated flatpaks. Usually it's in /var/lib/flatpak/runtime/. I did uninstall the old ones before trying the new packages.

lassekongo83 avatar Jul 12 '23 18:07 lassekongo83

This did not work on my end. Transmission from flathub is still not using the GTK4 theme. I also couldn't find the new install location for the updated flatpaks. Usually it's in /var/lib/flatpak/runtime/. I did uninstall the old ones before trying the new packages.

Same for me

julianfairfax avatar Jul 12 '23 18:07 julianfairfax

It's installed into the current user (that's what's the --user option for). You can remove that option to install it globally.

dusansimic avatar Jul 13 '23 07:07 dusansimic

org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/active/files do still not show any files from the gtk4 theme.

The directory layout should be: org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/[long number or symlink to active]/files/gtk-3.0 and org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/[long number or symlink to active]/files/gtk-4.0 for it to work correctly. (Unless I'm looking in the wrong place.)

lassekongo83 avatar Jul 13 '23 11:07 lassekongo83

org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/active/files do still not show any files from the gtk4 theme.

The directory layout should be: org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/[long number or symlink to active]/files/gtk-3.0 and org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22/[long number or symlink to active]/files/gtk-4.0 for it to work correctly. (Unless I'm looking in the wrong place.)

@dusansimic any update on this?

julianfairfax avatar Jul 24 '23 17:07 julianfairfax

Okay, so I've reached out to the flatpak community through their channels and found out that gtk4 themes are not supported through flatpak packages like org.gtk.Gtk3theme and almost definitely never will be.

What users can however do is do just what is described in the gtk4.md, override the theme directory with flatpak permissions. This would however require installing the gtk4 theme locally (for example in the .theme directory).

dusansimic avatar Jul 24 '23 19:07 dusansimic

Okay, so I've reached out to the flatpak community through their channels and found out that gtk4 themes are not supported through flatpak packages like org.gtk.Gtk3theme and almost definitely never will be.

The runtime needs to create a separate extension point for it https://github.com/flatpak/flatpak/issues/4605, only Gtk3 themes have extension now

https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/27825ba8d7720efe30d9f88650edcb88fd8a1c1e/elements/flatpak-images/platform.bst#L78

https://gitlab.gnome.org/GNOME/gnome-build-meta/-/blob/89623727ce7add26697e33ee0bc9ece077affa1f/elements/flatpak/platform.bst#L75

Then you can create a separate package like org.gtk.Gtk4theme.THEME

and almost definitely never will be.

I think it will be supported, just the work needs to be done. Pop, Yaru etc. are also interested in this.

Edit. Follow https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/697, https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1620

bbhtt avatar Jul 25 '23 03:07 bbhtt

FDO has been pushing back against us on this. I haven't even asked on GNOME's gitlab yet because I do not believe they will be sympathetic to the cause of theming. However, if FDO continues to refuse to integrate GTK4 until it meets whatever criteria GTK3 met to justify its inclusion, GNOME may be the only folks who can do it.

I brought up a question on FDO's tracker: the existence of GTK3 theme extension points was mainly only necessary because every GTK3 version kept breaking the way themes worked until around 3.18 or 3.20. Icon themes are actually just passed directly into the sandbox, exposed as /run/host/{share,user-share}/icons, because they're only images and it's safe.

So I want to ask: what's version churn like on GTK4 theme compatibility? Because it's possible that it may be better to take the same approach as is currently taken with icons and just pass them into the sandbox as-is. Do minor-versioned theme directories (gtk-3.18, gtk-3.20, gtk-3.22, etc) still exist in GTK4 in case they decide to go and break everything again?

TiZ-HugLife avatar Apr 18 '24 04:04 TiZ-HugLife

I have been researching about this issue recently, and to my surprise it works, on Fedora Silverblue system, when I put adw-gtk3 theme folders in /var/home/(myusername)/.themes, in other locations it just doesn't work, for me at least. I hope this info is helpful in some way.

AxelKelo avatar Jul 30 '24 23:07 AxelKelo