mate-desktop / mate-wayland-session

GNU General Public License v2.0
31 stars 5 forks source link

Some inaccuracy in README #17

Closed ilya-fedin closed 5 months ago

ilya-fedin commented 5 months ago

The README says:

Note that wayfire follows GNOME not MATE gsettings preferences for such things as fonts and icon themes. You can re-set these with dconf-editor for now, we need a fix for this in the future. A gsettings override file included with this package sets the MATE icon theme and Menta GTK theme and turns off overlay scrolling on a new or default install.

Although Wayfire should be unaware of that, it's gtk who uses GNOME's key directly nowadays. And I guess you won't really fix this unless you would convince GTK developers to change that.

lukefromdc commented 5 months ago

Does this mean it would be impossible for wayfire to offer an option to read MATE gsettings preferences due to being overridden by GTK? I know that in MATE in x11 we do not use the GNOME keys but our own, but there we have the xsettings manager (m-s-d). In wayland sessions one of the compositor's jobs is to serve as the "wayland settings manager," if not so we would be stuck with Adwaita and larger fonts with no way to change them.

I know that that GTK is hardcoded to ignore some keys entirely in and only in wayland sessions. Because of this I have to use the gtk3-classic patchset to keep certain GNOMEisms off my MATE session. Unless distros start offering that though, some of these (notably not using headerbars in dialogs) won't be available to most users with distro-supplied stock GTK 3. Nothing can be done about that in MATE or even in wayfire of course. Many more keys such as font and theme are still read in wayland sessions from gsettings, pretty sure that always defaults to GNOME unless an xsettings manager is changing that or a program is reading gsettings directly.

The question is thus this: can any wayland compositor override the default of which gsettings settings to read (acting as the settings manager) or is this x11-only?

Anyway, whether or not wayfire can override this, the real point is that MATE cannot as we are not managing that part of a wayfire session. That's why the gsettings override file is included: to override GNOME's defaults in and only in a MATE wayland session. User changes are of course applied in both mate and GNOME (if used) wayland sessions plus any GNOME x11 session. We can't change that, most users probably would want their preferred theme and fonts in all sessions but you can bet that won't be everyone.

If wayfire's devs would not be able to change this, I will update the README to reflect this. Thanks, and I've got more digging to do

ilya-fedin commented 5 months ago

Does this mean it would be impossible for wayfire to offer an option to read MATE gsettings preferences due to being overridden by GTK?

I don't imagine how wayfire can offer this, it likely doesn't even know what gsettings is. GTK doesn't override this, those keys are just what is read by gtk on Wayland: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/wayland/gdkscreen-wayland.c#L525 vs X11: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/x11/gdksettings.c#L27

In wayland sessions one of the compositor's jobs is to serve as the "wayland settings manager,"

No, there's no thing such as Wayland settings manager. GTK moved lots of things to being client-side with Wayland.

For the best experience, the compositor has to support the gtk-shell protocol though: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/wayland/protocol/gtk-shell.xml. It's the only integration between Wayland compositor and GTK (and it doesn't cover settings as you can see).

The question is thus this: can any wayland compositor override the default of which gsettings settings to read (acting as the settings manager) or is this x11-only?

Wayland compositor is not involved into this at all. Although, gtk uses portals when inside flatpak and one can return the GNOME keys from their own storage via own portal backend, it's even possible to force enable this outside of flatpak with GTK_USE_PORTAL=1 but this is likely to cause troubles (e.g. the trash can won't work) and is not invented to be used for any other purposes than debug ones.

That's why the gsettings override file is included: to override GNOME's defaults in and only in a MATE wayland session.

Other GTK-based DEs have apparently moved to applying the overrides to the GNOME keys and relying on distros to manage that. KDE has a daemon the synchronizes the settings with their ones. You have now to either change both MATE and GNOME keys or move to GNOME keys for both Wayland and X11 sessions.

GTK 4 defaults now to portal dialogs with the new GtkFileDialog API (so DEs can override the dialog), maybe it's possible to pursue them to do a similar thing with settings but I don't expect they will do any changes to GTK 3 now...

lukefromdc commented 5 months ago

README updated with https://github.com/mate-desktop/mate-wayland-session/commit/6f9dcaebd68e0a7d308516fe6b75bcaae16740f0 and https://github.com/mate-desktop/mate-wayland-session/commit/da4e3d5d9d6fd9234525c6d7c4c2de0fec19f85d

ilya-fedin commented 5 months ago

The inaccuracy is still here, it still says "wayfire follows GNOME not MATE gsettings preferences" while it's not wayfire who follows those preferences but GTK

lukefromdc commented 5 months ago

https://github.com/mate-desktop/mate-wayland-session/commit/55ec4dc2e6432b9e5a8ae4a94ca0c7904489ee09 indicates that the GTK default of reading GNOME gsettings is being applied.

Using only the GNOME keys for everything (especially in x11 too) would be problematic, because we apply within MATE itself many keys GNOME has removed. Some of this is going to be beyond my ability to manage myself without more people working on the wayland session

ilya-fedin commented 5 months ago

Well, any settings not mentioned in the gdkscreen-wayland.c should work via gtk's settings.ini, as it's the fallback

lukefromdc commented 5 months ago

At least using the GNOME gsettings keys we can change them and not be stuck with GTK's fallbacks. As for the gtk settings.ini, this is looked for in the themes and in ~/config/gtk-3.0 which is reserved for user customizations and must not be overridden. Setting the theme from within a theme via it's ini file would by comparison be world class chicken and egg.

ilya-fedin commented 5 months ago

I believe you can install it as /usr/share/gtk-3.0/settings.ini, /etc/gtk-3.0/settings.ini or /etc/xdg/gtk-3.0/settings.ini https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtksettings.c#L345-367

lukefromdc commented 5 months ago

I suspect that would override user-set themes

ilya-fedin commented 5 months ago

I suspect that would override user-set themes

According to the code, /usr/share/gtk-3.0/settings.ini has the least precedence. User config overrides it and gsettings overrides the user config.