24 May 2015

Many great GNOME 3 applications are used widely across various desktop environments. Most of them use GTK+ client-side decorations (csd) instead of window manager borders, which makes them look as strangers outside GNOME Shell. In this post I want to show you how to tweak window buttons layout for csd-enabled applications.


Classic window manager decorated window (Nemo) along with client-side decorated window (Nautilus)

Classic window manager decorated window (Nemo) along with client-side decorated window (Nautilus).

Facts

Since GTK+ 3.10, GtkHeaderBar widgets use gtk-decoration-layout setting value to display window control buttons in the right place & order. Default value is menu:maximize,minimize,close (format is the same as for window manager buttons layout).

Solution for Cinnamon

Cinnamon provide a way to override default gtk-decoration-layout setting value via dconf key gtk-decoration-layout in the org.cinnamon.desktop.interface section.

Let’s set close button + menu to the left, and minimize button to the right. You could use dconf-editor to change setting value from GUI. From command-line, it should be like this:

gsettings set org.cinnamon.desktop.interface gtk-decoration-layout 'close,menu:minimize'

Note what some buttons names are not supported, these are: above, stick, shade and separator. Hopefully, this will change in the future GTK+ versions.

More common way

For desktop environments, which don’t override gtk-decoration-layout setting, just change (or define) it in ~/.config/gtk-3.0/setting.ini like this:

[Settings]
gtk-theme-name=Adwaita
...
gtk-decoration-layout=close,menu:minimize

Session restart would be needed to apply changes. Also, if there are no settings.ini file, just create new one and add [Settings] line.

Results

Classic window manager decorated window (Nemo) along with client-side decorated window (Nautilus) - after changes

Classic window manager decorated window (Nemo) along with client-side decorated window (Nautilus) - after changes.



blog comments powered by Disqus