I am a student who did some web stuff and some command line applications, now giving GUIs a try. I read http://python-gtk-3-tutorial.readthedocs.org/en/latest/layout.html and I stumbled over this sentence:
Since GTK+ now supports Client Side Decoration, a Gtk.HeaderBar can be used in place of the title bar (which is rendered by the Window Manager).
Could somebody please explain what "client side decoration" is?
From reading http://blogs.gnome.org/mclasen/2014/01/13/client-side-decorations-continued/ I would guess that "client side decoration" is something like themes. Could somebody please explain how the window manager interacts with GTK+? Why is it called 'client side decoration'? What would be server side decoration? (Or another type of decoration?)
Traditionally, the GUI application would be responsible for the contents of its window, but not the title bar, close buttons, borders, resize grips, etc. Those would all be added by the window manager, and are called decorations.
(Examples of window managers are TWM, Fluxbox, Metacity, Mutter, etc.)
This is a bit of a simplified explanation, but this is how desktop themes are implemented; since the window doesn't know about its title bar, the window manager puts one on it that matches the current theme. If the user changes the theme, then the window just changes the title bar. Your application doesn't have to care.
On the other hand, this means that it's completely impossible for your application to customize the title bar in any way.
In recent years, it has become possible to tell window managers "no thank you, I don't want decorations," and render your own title bar instead. This is what GtkHeaderBar
is for — conserving ever more screen real estate by putting custom controls in the title bar, such as Chromium does with its browser tabs. This is called client-side decoration.
(Technically this was always possible, but easy to get wrong since you had to emulate all the functions of window decorations yourself, in the way users would expect them to work. GtkHeaderBar
does that for you.)
This is a double-edged sword, since with client-side decoration, your application won't react to a change in the window manager theme.
As for the name client-side, it comes from X terminology, where a client is an application which renders a window and sends it to the X server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With