Initial patch to provided shaped input support



Hi all,

I spent more time today working on getting support for
windows with shaped input. Due to the way that the frame
window is assumed at many levels within sawfish, it is
not practical to take the metacity approach where the
window is not reparented. Instead, I've implemented it
by taking the client window's input shape and applying
that to the frame as well.

If the frame style is 'none', then the frame is exactly
the same size as the client and will now have exactly
the same input shape, which is what we want.

One subtlety is that I have, perhaps gratuitously, used
a little trick so that if there is a frame, the frame
still has input, even if the client does not; in practice,
input shaped windows will almost always not want a frame.

The method for detecting the use of input shaping is
clunky but unavoidable - XShapeQueryExtents was not
extended or supplemented to query input shaping, so I
call GetRectangles and if there is not exactly one rectangle,
we know shaping is in use. There is a pathological case of
one rectangle that is smaller than the window, but surely
the window should be shrunk to that size as well. This case
is not worth worrying about.

The patch is not final because it does not do compile time
or runtime checks for XShape 1.1. Things will not go well
if you run a patched sawfish against Xorg < 6.9

http://intr.overt.org/diff.cgi/diffs/shaped-input.diff

I will take a look at putting the checks in when I get another
opportunity, or someone else could look at that. :-)

Enjoy!

--phil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]