Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK4 Flatpaks don't use adw-gtk3 #235

Open
6 of 8 tasks
julianfairfax opened this issue Jul 2, 2023 · 14 comments · May be fixed by flathub/org.gtk.Gtk3theme.adw-gtk3-dark#11 or flathub/org.gtk.Gtk3theme.adw-gtk3#10
Open
6 of 8 tasks

Comments

@julianfairfax
Copy link
Contributor

Prerequisites

Checklist to make sure the issue is not on your end

  • 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
  • The file ~/.config/gtk-3.0/gtk.css does not exist. (If it does, backup and remove it.)
  • 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
  • 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.
  • 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

@lassekongo83
Copy link
Owner

Any specific apps?

@julianfairfax
Copy link
Contributor Author

Any specific apps?

Transmission, for example.

@lassekongo83
Copy link
Owner

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.

@import '../gtk-3.0/libadwaita.css';

@dusansimic
Copy link

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
Copy link

@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

@julianfairfax
Copy link
Contributor Author

@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?

@lassekongo83
Copy link
Owner

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.

@julianfairfax
Copy link
Contributor Author

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

@dusansimic
Copy link

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

@lassekongo83
Copy link
Owner

lassekongo83 commented Jul 13, 2023

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.)

@julianfairfax
Copy link
Contributor Author

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?

@dusansimic
Copy link

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).

@bbhtt
Copy link

bbhtt commented Jul 25, 2023

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 flatpak/flatpak#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

@TiZ-HugLife
Copy link

TiZ-HugLife commented Apr 18, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants