As part of a still unpublished (or unadvertised, whatever) project, I was looking for how to do a simple window on top of the screen that would not steal focus but would still be able to receive keyboard events. Furthermore I was also looking for how to easily make this window partly transparent. It’s just all simple code-wise, but when you have no clue on how to do it, it’s not that easy.
I learnt that popup windows aren’t stealing focus, that I could grab the keyboard only (but that I can not grab it while a key is pressed because there is already another active grab then), and that using Composite extension was just about setting the right colormap and using Cairo to draw on the window surface by hooking in the expose events.
Sadly I also learnt that it wasn’t currently possible to draw transparent widgets since they own their region so that what’s under it (in the same window) can not be used for compositing (which results into an awful dark background behind the widget). The only workaround I found was drawing the widget on its own Cairo surface and draw that surface at the right place after painting the window background.
I have included the full sample code featuring all this but the workaround for transparent widgets.
