Skip to content

gtk3-module: Apply Cinnamon's dialogs-use-header on Wayland - #224

Open
SyberHexen wants to merge 1 commit into
linuxmint:masterfrom
SyberHexen:3.4.3/wayland-dialog-buttons
Open

SyberHexen wants to merge 1 commit into
linuxmint:masterfrom
SyberHexen:3.4.3/wayland-dialog-buttons

Conversation

@SyberHexen

Copy link
Copy Markdown

Bug: in a Cinnamon Wayland session every GTK 3 dialog (file chooser, Save As, message dialogs) gets a header bar with the buttons at the top, although Cinnamon's dialogs-use-header setting is false. On X11 cinnamon-settings-daemon passes that setting to applications through XSettings; GTK's Wayland backend has no XSettings and supplies gtk-dialogs-use-header itself, as TRUE. settings.ini can't override it, because the backend's value outranks it; only a value the application sets does.

Reproduce: Cinnamon Wayland session, any GTK 3 app, File → Open: the dialog has a header bar with Cancel/Open at the top. In the X11 session the same dialog has its buttons at the bottom. A quick check from Python:

GDK_BACKEND=wayland python3 -c "import gi; gi.require_version('Gtk','3.0'); from gi.repository import Gtk; print(Gtk.Settings.get_default().props.gtk_dialogs_use_header)"

prints True on Wayland (and False with GDK_BACKEND=x11), with org.cinnamon.settings-daemon.plugins.xsettings dialogs-use-header set to false.

Fix: the XApp GTK 3 module, which Cinnamon sessions already load into every GTK 3 application, sets Cinnamon's dialogs-use-header value on the application's GtkSettings when the display is Wayland, and follows changes to the setting. X11 is unchanged (XSettings keep handling it). It only acts when the cinnamon xsettings schema and key exist.

Tested: Cinnamon Wayland session: gtk-dialogs-use-header is False and a GtkFileChooserDialog has no header bar (before: True, header bar); toggling the setting in Cinnamon is followed by running apps; X11 session unchanged.

On X11, cinnamon-settings-daemon gives applications Cinnamon's
dialogs-use-header setting (dialog buttons at the bottom by default)
through XSettings. GTK's Wayland backend has no XSettings and supplies
gtk-dialogs-use-header itself, as TRUE, over settings.ini, so on Wayland
every GTK 3 dialog got a header bar. Only a value the application sets
outranks the backend: in Cinnamon on Wayland, the module sets Cinnamon's
value in each application and follows its changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant