It turns out that Mirco “MacSlow” Mueller beat me to it, with his awesome Cairo Clock demos!
It’s nice to see that somebody else is producing demos of how to do this stuff – I found the code I needed by asking the GTK+ people, who pointed me towards the “testgtk.c” testcase file in CVS. A bit hard to find on your own! I wish I’d know about Mircos work before. Get your work on the Cairo examples page dude!
He has also done it far better than I did, with even a spiffy video to go with the code. That said, the code to set input area along with the drawing is quite complicated, so hopefully GTK+ will soon be supporting all this natively so we don’t have to write the boilerplate screen/cm handling code over and over (as pointed out by desrt in the comments, I got this slightly wrong).
Ray Strode says that Metacity already marks its presence in a detectable way, and I know the XFCE compositor does as well. The protocol these programs are using needs to be documented somewhere (EWMH spec?), or maybe the Composite extension home page on freedesktop.org
A few questions remain:
- Is it possible to get a pixmap containing whatever is underneath your window? Right now we can draw an alpha channel and get translucency, which is great. But how would you make a window that blurs whatever is underneath it (to give a thick-sheet-of-glass effect?).
- The window tears when resizing on my computer and in MacSlows demo. Is this fixed by the new compiz/metacity compositors?