Bug 478266

Summary: UI for configuring button visibility/order for GTK CSD windows
Product: [Applications] systemsettings Reporter: Quinten Kock <quinten>
Component: kcm_kwindecorationAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: be.0, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.27.9   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Quinten Kock 2023-12-08 15:40:06 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Gnome applications with CSDs are not affected by changing the settings in Titlebar Actions. This makes sense, however: Gnome allows customizing the behaviour of titlebar actions too, and when you change them in Gnome (via e.g. gnome-tweaks) they also affect GTK CSDs. It would be nice if the KCM was able to configure this, whether automatically synced or not.

Automatic syncing is probably undesirable for various reasons, not in the least that Gnome's options are less flexible. But adding these options to the KCM might be nice, so that a user can easily change the GTK CSD behaviour (similarly to how the Application Style KCM can change the GTK style).


STEPS TO REPRODUCE
1. Change Titlebar actions to e.g. minimize on middle click.
2. Open a GTK app with CSD
3. Try to use the modified shortcut

OBSERVED RESULT
Default (GNOME) behaviour

EXPECTED RESULT
Either customized KDE behaviour, or having an option to customize the GTK behaviour.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-12-08 16:10:07 UTC
Yeah, doing it automatically is out of the question since the capabilities of GTK CSDs and non-GTK SSDs differ; they don't have the same buttons, you can move all buttons to the other side of the window, etc. We would have to make this GTK CSD configurator an explicitly separate thing to avoid making promises we can't keep/
Comment 2 Be 2025-10-03 00:49:38 UTC
There already is a settings page for configuring the position of window control buttons, it's just not adjacent to the rest of the titlebar settings so it's easy to miss: https://bugs.kde.org/show_bug.cgi?id=503513 I didn't know it was there until I found that bug report.

The Titlebar Buttons page does manipulate the org.gnome.desktop.wm.preferences.button-layout dconf setting, so it does affect libadwaita applications, as well as Firefox. I doubt KDE's settings should be writing GNOME's settings though. 

There is an open pull request for the XDG Desktop Portal (https://github.com/flatpak/xdg-desktop-portal/pull/1821) to expose this setting in a standardized cross-desktop way. I think KDE should store its own settings configured in System Settings and xdg-desktop-portal-kde should expose those via the proposed API (https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/issues/14) instead of writing to GNOME's dconf setting.
Comment 3 Be 2025-10-03 01:10:35 UTC
I noticed that Titlebar Buttons changes the dconf value in a way that messes with GNOME Tweaks. The default dconf setting uses ":appmenu" at the end of the string to indicate buttons on the left and "appmenu:" at the beginning of the string to indicate buttons on the right. But KDE's settings write ":icon" or "icon:" to the dconf value.