It turns out my computer at work has the fancy nVidia card necessary to run X + the compositing extension, so now all of my windows have gratuitous drop shadows. (It's no XGL/Compiz, though...)
I had originally intended for Ghosd to use this extension when it was available, for it allows hardware acceleration of "real" transparent windows. But now that I have hacked it up (surprisingly easy, by the way:
_NET_WM_WINDOW_OPACITY), I realize it's not enough, for two reasons:
- The current Ghosd drawing model is that if you draw any shape with alpha < 1, the screen shows through. It's as if you're drawing to the screen directly. This is hard to rectify with a window-level alpha.
This is fixable; it's not hard to change the API to have a window-level alpha in addition to the existing alpha support.
- But, even with that, when you do draw to the window with alpha < 1, Cairo wants to merge that color with whatever is underneath, so you need some color underneath. So I need to copy the screen anyway.
But now that I've written all that, it may be worth special-casing window-level alpha anyway, as it's likely I can fade the alpha much more quickly using the hardware than what I'm doing right now (rapidly redrawing/combining with different levels of alpha). This would allow rapid fade-ins and fade-outs.