Why GTK_THEME env breaks Adwaita applications?

Why GTK_THEME enviroment variable breaks Adwaita applications?

Because libadwaita contains its own style, and overriding it will cause breakage onto unsuspecting libraries and applications.

The GTK_THEME environment variable is only meant as a debugging tool, not as user configuration; see:

Yeah, we’ll start unsetting GTK_THEME from libadwaita in future, there’s a lot of confusion around it:

Some apps already unset it: for example: build-aux/org.gnome.World.PikaBackup.Devel.json · main · World / Pika Backup · GitLab

Ok, but since the applications using Libadwaita, why is GTK_THEME overwriting?

I think shouldn’t do it. The problem is with old installations and will resolve itself.

GTK uses CSS, which (as the name implies) cascades through multiple layers.

Adwaita is using GTK, and GTK_THEME overrides the system theme; so the changes that Adwaita imposes on widgets will not work any more.

No, it won’t resolve itself, unless GTK stops honouring the GTK_THEME environment variable, or breaks its semantics.

But if:
GTK use by default theme Default from hard coded path (or is this also configurated with GTK_THEME?)
GTK_THEME setups different path
Libadwaita sets GTK_THEME variable

How GTK_THEME can override Libadwaita stylesheet if Lbadwaita always sets its own end of the chain?

Libadwaita doesn’t use GTK_THEME for this, no. In fact, its styles aren’t even a theme.

Then, can you explain, how Libadwaita works? IMy understanding is that it’s just a library that make new more complicated elements/widgets from GTK elements/widgets and it contains a stylesheet that controls colors and shapes (theme).

Is this how GTK works:

Libadwaita? It sets gtk-theme-name (not GTK_THEME) to an empty theme and loads styles using Gtk.StyleContext.add_provider_for_display

GTK_THEME overrides gtk-theme-name and breaks everything.

GTK_THEME is a debug variable, it’s not configuration and never was that.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.