Packaging ships /etc/gtk-3.0/settings.ini, forcing the GTK3 theme to Yaru and preventing flavors from overriding it with XDG configuration

Bug #2047705 reported by Aaron Rainbolt
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gtk+3.0 (Ubuntu)
Incomplete
Low
Unassigned
lxqt-session (Ubuntu)
Fix Released
High
Simon Quigley

Bug Description

Lubuntu uses Qt as the primary framework for most of the apps we ship. However, some functionality we ship in Lubuntu doesn't have a Qt application that provides that functionality, so we have some GTK3 apps that we ship as well. Starting in Lubuntu 24.04, we are adding and enabling the breeze-gtk-theme package, providing more uniform theming between Qt and GTK apps on Lubuntu. However, this bug makes this impossible.

As we do not ship xsettingsd, but instead use the XDG specification for shipping configuration, we are attempting to place the default configuration files for GTK2 and GTK3 theming in /etc/xdg/xdg-Lubuntu/gtk-2.0/gtkrc and /etc/xdg/xdg-Lubuntu/gtk-3.0/settings.ini. This solutions works for GTK2 apps, however GTK3 apps silently ignore the vendored configuration file and are using a different theme.

As it turns out, this is because the /etc directory is given higher priority than /etc/xdg/xdg-Lubuntu when searching for XDG configuration files, and as it happens, libgtk-3-0 ships a /etc/gtk-3.0/settings.ini file that sets Yaru as the default theme. GTK3 applications end up selecting this configuration file rather than /etc/xdg/xdg-Lubuntu/gtk-3.0/settings.ini.

/etc/gtk-3.0 is, I would argue, *not* a place where GTK3's settings.ini file should go, as it makes it difficult for flavors who rely on XDG configuration to override it without risking a file conflict. (Technically I guess a flavor package *could* use dpkg-divert to simply "get rid of" the /etc/gtk-3.0/settings.ini file, but that seems like the wrong way to approach this.)

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: libgtk-3-0 3.24.38-5ubuntu2
ProcVersionSignature: Ubuntu 6.5.0-9.9-generic 6.5.3
Uname: Linux 6.5.0-9-generic x86_64
ApportVersion: 2.27.0-0ubuntu6
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: LXQt
Date: Fri Dec 29 10:08:23 2023
InstallationDate: Installed on 2023-10-22 (69 days ago)
InstallationMedia: Lubuntu 23.10 "Mantic Minotaur" - Release amd64 (20231010)
SourcePackage: gtk+3.0
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Aaron Rainbolt (arraybolt3) wrote :
Simon Quigley (tsimonq2)
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → Critical
status: New → Confirmed
tags: added: rls-nn-incoming
Simon Quigley (tsimonq2)
Changed in lxqt-session (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Simon Quigley (tsimonq2)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxqt-session - 1.4.0-0ubuntu3

---------------
lxqt-session (1.4.0-0ubuntu3) noble; urgency=medium

  * Copy over GTK 3 settings by default (LP: #2047705).

 -- Simon Quigley <email address hidden> Fri, 29 Dec 2023 12:36:24 -0600

Changed in lxqt-session (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Simon Quigley (tsimonq2) wrote :

A bug still exists here. GTK as a standalone package should not set Yaru as a default, especially if it doesn't declare it as a dependency.

lxqt-session was simply a workaround. The Ubuntu Desktop Team needs to move this to their default settings package, and adjust GTK to appropriately read $XDG_CONFIG_DIRS for the appropriate configuration.

Changed in gtk+3.0 (Ubuntu):
importance: Critical → Low
Revision history for this message
Sebastien Bacher (seb128) wrote :

Hey there, thanks for the bug report.

@Simon, First I'm lowering the severity because I don't think it's breaking systems in a way that justify the important you set

> As it turns out, this is because the /etc directory is given higher priority than /etc/xdg/xdg-Lubuntu when searching for XDG configuration files

I don't think that's true, it's iterating over XDG_CONFIG_DIRS and stops to the first match which should be etc/xdg/xdg-$desktopsession

I've just tried under a wmaker session (makes it easier to confirm the behaviour of gtk because in modern desktops the theme default can be overwritten from xsettings or portal) when I copied the file to /etc/xdg/xdg-wmaker/gtk-3.0/settings.ini and edited the theme to Adwaita and confirmed restarting gtk3-demo it was using Adwaita instead of Yaru

I would also advice to not do what you did in lxqt-session, if I understand the change correctly you are creating a local user configuration which isn't likely to stick around without the user knowing about it and which isn't desktop specific so will create problems for the users if they log into another desktop environment later on...

Jeremy Bícha (jbicha)
Changed in gtk+3.0 (Ubuntu):
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.