I decided to engage in some blingineering today, and put together a self contained demo of how to make a semi-transparent window (ie with an alpha channel) using GTK+. For this, you will need GTK+ 2.8 or higher, Cairo, a modern X server and a running compositing manager. Any very recent Linux distro should meet the bill, I’m using SUSE 10.1.
This stuff should be documented in the GTK+ manual proper I guess, but hopefully Google will see this and it’ll go into the global pool of knowledge along with everything else. There are still a couple of problems:
- It’s not clear to me how to detect if a compositor is running or not. I guess there should be (maybe is) a simple X property on the root window you can check to see if one is running. Until we fix that it’s hard to use this technique in production software because people not running a compositing manager will see a black background instead of a transparent one.
- There should be a more convenient API in GTK+ for this, gtk_window_set_translucent() or something. Maybe we need a SexyWindow class, Christian?