After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790201 - Settings in ~/.config/gtk-3.0/settings.ini ignored with GDK_BACKEND=wayland
Settings in ~/.config/gtk-3.0/settings.ini ignored with GDK_BACKEND=wayland
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-11-11 08:40 UTC by Alex Ivanov
Modified: 2017-11-27 00:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ability to use GtkSettings under Wayland (1.33 KB, patch)
2017-11-15 09:25 UTC, Alex Ivanov
rejected Details | Review
don't provide gsetting if dconf is not available (478 bytes, patch)
2017-11-15 13:08 UTC, Alex Ivanov
accepted-commit_now Details | Review

Description Alex Ivanov 2017-11-11 08:40:25 UTC
Seen at least with weston and sway compositors.

1. If GDK_BACKEND=x11 everything works correctly, settings from ~/.config/gtk-3.0/settings.ini get applied
2. If GDK_BACKEND=wayland settings ignored (at least theme and font)
3. GTK_THEME environment variable works
Comment 1 Alex Ivanov 2017-11-15 09:25:55 UTC
Created attachment 363663 [details] [review]
ability to use GtkSettings under Wayland

This patch adds GDK_WAYLAND_USE_GTKSETTINGS environment variable which when is set allows to pick settings from GtkSettings (settings.ini and friends) instead of GSettings (dconf and friends)
Comment 2 Emmanuele Bassi (:ebassi) 2017-11-15 11:31:45 UTC
I very, *very* much doubt we're going to add a new environment variable for that, but I'll let the maintainer of GTK to answer this authoritatively.

The only reason why the X11 backend falls back to the settings.ini file is because you're clearly not running an XSettings bridge, to expose settings (coming from GSettings, in the GNOME/GTK case) over X11 events. Since Wayland does not have this weird contraption, we access GSettings directly, if its available on the system.

My strong suggestion is for you to change the GSettings, if you're running under Wayland, instead of trying to use a key/value file for everything. Alternatively, remove dconf, and GTK will use the settings.ini file.
Comment 3 Alex Ivanov 2017-11-15 11:57:15 UTC
> My strong suggestion is for you to change the GSettings, if you're running under Wayland, instead of trying to use a key/value file for everything

That's hard to achieve outside of Gnome, because then I need to figure what exact parts of Gnome (gnome session, gnome settings and etc daemons) to run to get Gtk3 applications see my dconf settings.
Also available customization programs like lxappearance or kde-gtk-config still use settings.ini.

> Alternatively, remove dconf, and GTK will use the settings.ini file

Strange, but that doesn't work for me. If dconf is not available, then gdkscreen-wayland uses built-in defaults https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkdisplay-wayland.c#n1571
forcibly overriding GtkSettings.
Here's another user having the same issue https://bbs.archlinux.org/viewtopic.php?id=225553
Comment 4 Alex Ivanov 2017-11-15 13:08:02 UTC
Created attachment 363679 [details] [review]
don't provide gsetting if dconf is not available

Fix for Emmanuele Bassi case
> Alternatively, remove dconf, and GTK will use the settings.ini file
Prior default from translation table (https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkdisplay-wayland.c#n1571) was taken. In init_settings() we return if g_settings_schema_source_get_default() fails, so we should do in gdk_wayland_display_get_setting(). This now matches what gdkscreen-x11.c does (in case of not available xsettings) https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkscreen-x11.c#n958

However this patch doesn't fix the issue, since at least some distributions wrap Gtk3 programs with GSettings schemas path https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/p2p/transmission/default.nix#L46
Comment 5 Alex Ivanov 2017-11-20 09:05:48 UTC
> That's hard to achieve outside of Gnome, because then I need to figure what exact parts of Gnome (gnome session, gnome settings and etc daemons) to run to get Gtk3 applications see my dconf settings

Ok, I was wrong with that. What is needed is gsettings_desktop_schemas in XDG_DATA_DIRS
Comment 6 Matthias Clasen 2017-11-21 16:08:57 UTC
Review of attachment 363663 [details] [review]:

as ebassi said, we're not going to introduce more random environment variables for this
Comment 7 Matthias Clasen 2017-11-21 16:13:00 UTC
Review of attachment 363679 [details] [review]:

this one is plausible