PolyMeilex / sctk-adwaita

Adwaita-like SCTK Frame
MIT License
26 stars 19 forks source link

Configurable title bar buttons layout #27

Closed ilya-m32 closed 1 year ago

ilya-m32 commented 1 year ago

Hi @PolyMeilex,

First of all, thank you for this wonderful project. I was happy to notice that after getting an updated version of alacritty I have a much more consistent title bar in my gnome wayland session - thanks to the library.

Problem statement

One of the remaining inconsistencies (for my scenario) is that in the gnome shell you can move the close/minimize/maximize buttons to the left side, similar to how it was in Unity or now in OS X.

Example in gnome-terminal

It's not really available via standard gnome settings but can be changed via gnome-tweaks or gsettings. The setting is also mentioned in the gnome documentation and seems to be widespread enough.

Possible solution

We could support this behavior in sctk-adwaita without adding dependencies from Gnome.

Button layout configuration is available via dbus-send, similar to dark mode detection:

$: dbus-send --session --print-reply=literal --reply-timeout=1000 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.gnome.desktop.wm.preferences' string:'button-layout'

variant       variant          close,minimize,maximize:%

I played with the library a little bit and I was able to quickly make a proof of concept of configurable button layout in sctk-adwaita: Proof of concept

I also checked if there is a freedesktop spec for this, but unfortunately I couldn't find it.

Next steps

Will you theoretically accept MR with this feature if I convert my PoC to a real feature branch? If yes, then I am ready to do it in the near future.

Please let me know wdyt.

PolyMeilex commented 1 year ago

Sounds good, I would prefer the standardized key: https://github.com/flatpak/xdg-desktop-portal/pull/996 instead of gnome one, but until that lands I'm ok with gnome specific solution.

ilya-m32 commented 1 year ago

Great, I will follow up on this soon. Also good to see this property get standardized.

orowith2os commented 1 year ago

Nice to see my pull request being mentioned, if anyone has thoughts on how I have it laid out I'm all ears.