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

Install Gtk3 theme versioned #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TingPing
Copy link
Contributor

This allows multiple Gtk versions to be installed and themed properly.

On a side note this manually calling cp to install everything is awful, would you mind me completely redoing all of that (and possibly moving around some files)?

@horst3180
Copy link
Owner

I see some problem with this:

  • GTK 3.14 doesn't support versioned directories. From what I see, this patch hasn't been backported to 3.14. This means the theme for GTK 3.14 has to be installed to gtk-3.0.
  • You'll have to run the installation process multiple times to install multiple version.
  • gnome-tweak-tool doesn't recognize themes without gtk-3.0 directory, so you won't be able to select it.

I'd appreciate improvements to the build system, though. Maybe open an issue were we discuss the details?

@TingPing
Copy link
Contributor Author

You'll have to run the installation process multiple times to install multiple version.

I planned a second patch to solve this.

gnome-tweak-tool doesn't recognize themes without gtk-3.0 directory, so you won't be able to select it.

I can look into fixing that upstream.

GTK 3.14 doesn't support versioned directories. From what I see, this patch hasn't been backported to 3.14. This means the theme for GTK 3.14 has to be installed to gtk-3.0.

I'll fix that.

This allows multiple Gtk versions to be installed
and themed properly.
@TingPing
Copy link
Contributor Author

@horst3180
Copy link
Owner

It seems I missed the notification that you updated this :D.

Do you know if that gnome-tweak-tool patch will be backported to 3.16 and 3.18? I can't merge this until the patched tweak tool is available to distros, because I really don't want to break the theme selection.

I thought about a slightly different approach:

  • By default install all available versions of the GTK 3 theme into versioned directories, with the 3.14 version going into gtk-3.0 and completely ignore GNOME_VERSION for the GTK 3 installation.
  • If the --with-gnome=... option is set, only install the corresponding GTK 3 theme to gtk-3.0, i.e. it should override GNOME_VERSION like before and change the GTK 3 installation routine to only install common/gtk-3.0/$GNOME_VERSION to $themedirectory/gtk-3.0.

This way gnome-tweak-tool will always recognize the theme and multi version support can still be disabled. I don't think we need to add the option to disable certain GTK 3 versions specifically.

@horst3180
Copy link
Owner

Or to make things even simpler, we could always install all GTK 3 versions and leave the rest as it is. It'll add less than 1MB to the installed size.
I can't see any downsides in this apart from a slightly larger install size (which shouldn't matter at all nowadays).

@TingPing
Copy link
Contributor Author

TingPing commented Apr 4, 2016

I pushed it to the older branches; I imagine another 3.16 release is unlikely though I don't really know his release policy.

If the --with-gnome=... option is set, only install the corresponding GTK 3 theme to gtk-3.0

Seems reasonable for a short term solution until tweak tool catches up.

By default install all available versions of the GTK 3 theme into versioned directories, with the 3.14 version going into gtk-3.0 and completely ignore GNOME_VERSION for the GTK 3 installation.

I don't think 3.14 should be installed in this situation, it could create a problem where it loads that version on a newer release.

@horst3180
Copy link
Owner

The loading part is entirely up to GTK itself. It'll only use gtk-3.0 if it doesn't find any newer versions (https://git.gnome.org/browse/gtk+/tree/gtk/gtkcssprovider.c#n2007)

@TingPing
Copy link
Contributor Author

TingPing commented Apr 4, 2016

The loading part is entirely up to GTK itself. It'll only use gtk-3.0 if it doesn't find any newer versions

I know and that could lead to a poor UX. User upgrades gnome version and suddenly they are on the 3.14 version which looks broken. Falling back to Adwaita because there is no new version is a much clearer issue and leaves the applications usable.

@horst3180
Copy link
Owner

I'm not sure if I understand this correctly.
Let's say a user upgrades from 3.20 to 3.22 in the future, but the theme only has gtk-3.0, gtk-3.16, ..., gtk-3.20 directories. In that case GTK will always use gtk-3.20, regardless if gtk-3.0 exists or not.

@TingPing
Copy link
Contributor Author

TingPing commented Apr 4, 2016

Oh sorry it was me who misunderstood.

@chewi
Copy link
Contributor

chewi commented Oct 8, 2016

I just had a user file a Gentoo bug report because of this. Could we please make it happen?

@HEXcube
Copy link
Contributor

HEXcube commented Oct 9, 2016

gnome-tweak-tool doesn't recognize themes without gtk-3.0 directory, so you won't be able to select it

@horst3180 GNOME Tweak Tool 3.20 fixed the issue and is now able to load versioned themes that don't contain a gtk-3.0 directory. This fix got backported to v3.18 too. However, the official tarballs are still at 3.18.1 😞

But, this issue can be workarounded by renaming/symlinking the lowest version gtk-3.xx theme as gtk-3.0. Tweak Tool just needs to see a gtk-3.0 directory in the theme for it to be selectable. GTK'll still load theme from gtk-3.18 if it's present.

@horst3180
Copy link
Owner

horst3180 commented Oct 9, 2016

@HEXcube Yeah, that's not a problem. I'll have to put the 3.14 theme into gtk-3.0 either way, because GTK 3.14 doesn't support multi version.
I just have to figure out how to exactly implement it. If possible I want a build option to disable multi version.

@HEXcube
Copy link
Contributor

HEXcube commented Oct 9, 2016

I'll have to put the 3.14 theme into gtk-3.0 either way, because GTK 3.14 doesn't support multi version.

@horst3180 Maybe keep a separate gtk-3.14 folder to be consistent with gtk-3.16, gtk-3.18 and those higher version folders, and then place gtk-3.0 as a symlink to it? 🤔

@TingPing
Copy link
Contributor Author

TingPing commented Oct 9, 2016

@HEXcube No reason to over-complicate it.

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

Successfully merging this pull request may close these issues.

4 participants