GNOME Bugzilla – Bug 790201
Settings in ~/.config/gtk-3.0/settings.ini ignored with GDK_BACKEND=wayland
Last modified: 2017-11-27 00:33:15 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
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)
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.
> 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
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
> 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
Review of attachment 363663 [details] [review]: as ebassi said, we're not going to introduce more random environment variables for this
Review of attachment 363679 [details] [review]: this one is plausible