cgtkgtk3gnome-3window-decoration

How do client side decorations work with Gnome 3.10 and GTK 3?


As the title says, how would you go about converting a standard GTK3 application written in C (although Python should work as well with the gobject bindings) to have client-side decorations? I really like the idea, but I couldn't find anything that did this other than the default Gnome 3.10 apps (settings, tweak tool etc.)


Solution

  • GTK+ windows by default are decorated by the window manager. You can request the titlebar of an application be replaced in GTK+ 3.10 or higher by calling

    gtk_window_set_titlebar(window, header);
    

    where header is a GtkHeaderBar widget and window is the window you wish to have client side decorations. The official GNOME documentation has more information on this subject. As far as I gather the window manager is under no obligation to respect this request and can continue decorating it in the server.