Ubuntu / Linux news and application reviews.

Starting with GNOME 3.10, some GNOME applications have switched to "header bars" or "client-side decorations". These CSD (client-side decorations) don't work properly in some desktop environments / shells - for instance, in Ubuntu 14.04, Unity doesn't support CSD and because of this, some applications look broken. Luckily, there is now a relatively easy way (unofficial) of disabling client-side decorations. Read on!

In Ubuntu, Nautilus and a few other GNOME apps are patched so they don't use client-side decorations under Unity. However, not all applications were fixed - here are a few examples:

GNOME Clocks

Latest gThumb 3.3.2 (gThumb from the Ubuntu repositories was downgraded when the Ubuntu devs noticed it's using CSD)


PCMan, one of the LXDE founders, has created gtk3-nocsd, a small module which can be used to disable the GTK+3 client-side decorations. gtk3-nocsd can achieves this by letting GTK think there's no compositor available, in which case the CSD fail to start.

Here are the same 3 applications as above, with gtk3-nocsd (so with disabled client-side decorations), under Ubuntu 14.04 LTS:

Update (7 Oct 2015): back when we first wrote about gtk3-nocsd, there were some issues. Firstly, it couldn't be used globally under Unity, so you had to manually edit the desktop file for each application you wanted to use it with or launch the app from the command line. Another issue was that the CSD close button would still show up even if a CSD application used a traditional titlebar. And finally, the tool didn't support all client-side decoration applications (for instance it didn't work with GNOME Weather).

Well, gtk3-nocsd was updated recently and all these issues were fixed for this release.

Also, gtk3-nocsd works with GTK3 older than version 3.16.1 or newer than version 3.17.3. That means it's compatible with Ubuntu 14.04 and 15.04 but not with the latest Ubuntu 15.10.

Install gtk3-nocsd

Ubuntu 14.04 or 15.04 users can install gtk3-nocsd by using the main WebUpd8 PPA. To add the PPA and install gtk3-nocsd, use the following commands:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install gtk3-nocsd

Or, if you don't want to add the PPA, download the gtk3-nocsd deb from HERE.

Other Linux distributions: grab the gtk3-nocsd code from GitHub, make sure pkg-config and gtk+3-dev are installed and compile it using "make".

Simply installing gtk3-nocsd won't disable the GTK3 client-side decorations. See the example below for how to use it.

Disable GTK3 client-side decorations using gtk3-nocsd (example)

To be able to use gtk3-nocsd, you need to preload the gtk3-nocsd.so file (which is installed under /usr/lib/gtk3-nocsd/ if you've used the Ubuntu PPA mentioned above) using LD_PRELOAD.

Update: for the latest version, the file is now called "libgtk3-nocsd.so.0" however, the PPA package continues to use the old filename (gtk3-nocsd.so) for compatibility purposes.

You can disable GTK3 client side decorations in two ways: either loading it in your ~/.bashrc or ~/.profile, which means that gtk3-nocsd will be used globally (but for your user only), without having to modify anything else, or you can use it for specific applications only.

While the bug that was breaking Unity was fixed, using this globally may still cause issues with various apps so I recommend using gtk3-nocsd for specific apps only (method A)!

A. To use gtk3-nocsd with specific applications, you'll need to open the application .desktop file with a text editor and add "env LD_PRELOAD=/usr/lib/gtk3-nocsd/gtk3-nocsd.so" (without the quotes) to the Exec line, just after "=".

Here's an example: to disable the client-side decorations for gThumb 3.3.2, open its desktop file as root with a text editor (I'll use Gedit below):
gksu gedit /usr/share/applications/gthumb.desktop

(alternatively, you can also copy the .desktop file to your ~/.local/share/applications/ folder and edit it there)

And in this file, search for the line that starts with "Exec=" and right after "=" and before "gthumb", add the following (without removing anything!):
env LD_PRELOAD=/usr/lib/gtk3-nocsd/gtk3-nocsd.so

After editing gthumb.desktop, the "Exec=" line should look like this:
Exec=env LD_PRELOAD=/usr/lib/gtk3-nocsd/gtk3-nocsd.so gthumb %U

In the same way you can disable client-side decorations for any application you want: GNOME Clocks, GNOME Maps, etc.

B. To use gtk3-nocsd globally (for all applications but for your user only), open ~/.profile with a text editor - I'll use Gedit below:
gedit ~/.profile
And at the end of the file, paste this:
export GTK_CSD=0
export LD_PRELOAD=/usr/lib/gtk3-nocsd/gtk3-nocsd.so

Then save the file, restart the session (log out) and that's it! If later on you don't want to use gtk3-nocsd, simply remove these lines from your ~/.profile

Report any issues you may find with gtk3-nocsd @ GitHub.