Wow, it’s been almost two months since my last post but well, now I’ve got something worth writing about.
I happen to be one of those strange people who still stubbornly uses sawfish, despite its minimally maintained state. Now is not a good time to be using an unmaintained window manager if you’re not prepared to get your hands dirty, what with all the eye candy developements as of late. Amit Gurdasani implemented ARGB visuals and I added support for basic opacity effects last year, but this is not enough for the emerging set of fancy widgets like Cairo Clock. These rely on shaped input to properly implement non-rectangular windows, and sawfish does not handle this situation well.
First, let me discuss how Metacity and Compiz handle shaped input. Metacity doesn’t directly address it, but support comes for free because windows that request not to have decorations do not get reparented into a frame window. As such, the input shape just works. Similarly, Compiz never reparents client windows – instead it draws decorations and peers of the client.
In contrast, sawfish always reparents managed windows into a frame – even if there are no decorations. This characteristic is assumed at many levels in the code, so it is not practical to implement the Metacity behaviour. Fortunately, there was another way: sawfish already carries over a window’s bounding shape when constructing the frame, so I made a change to carry the input shape over as well, and it works perfectly well. The only ugly thing is that there doesn’t appear to be any way to directly query whether input is shaped or not – I had to do it indirectly by counting the number of shape rectanges. Am I missing something?
My patch is not finished yet because it doesn’t do compile time and run time checks for XShape 1.1, but should be functionally complete.
Let’s see how many other sawfish users there still are out there
This morning, I realised that it’s completely unnecessary to check if the client window is doing input shaping because a normal window has a window shape that exactly covers the window. This means that the logic that merges the client shape to the frame will still do the right thing for normal windows – even if the work is redundant. So I’ve updated the diff to remove the clunky checks. Now it’s much more elegant.