Event redirection adventures

Matthias Hopf mhopf at suse.de
Wed Jan 11 09:37:56 PST 2006


On Jan 09, 06 02:03:04 -0800, Keith Packard wrote:
> There are two basic computations needed in this environment. The first
> is to transform an arbitrary screen position to a position relative to a
> specific window (coord transformation). The second is to detect which
> window is directly under a specific screen position (hit detection).

Hm. As far as I understand the issue, these two problems basically fall
into one (coord trafo) - for hit detection one could just check the
normalized transformed coordinates for 0<x,y<1 - and of course check for
shaped windows, etc.

Of course, this is O(n), and coord trafo can be expensive. If there are
too many windows to be checked, an extra hit detection would be usefull
(and eventually be implemented e.g. in Xgl with OpenGL picking).

> One thing I'd like to see discussed here is whether it makes any sense
> to try and stuff suitable transformation data inside the X server.

This will only work for special cases (not the generalized one), so
maybe asking the composition manager should be the first implementation.

> Cosider a simple 32-bit pixmap 'painted' with Window IDs. This could be
> used for efficient hit detection and would make XYToWindow at least as
> fast as it is today.

A composition manager could have that by OpenGL picking, which could be
lightning fast as well - but then we have the round trips. Oh well.

Also keep in mind that in order to keep this XID pixmap acurate you will
have to do a lot of memory accesses during resizes, movements, and
creation/destroying windows. This could make window movement/resizing
slower than it used to be.

I'm not sure what's the best idea WRT this issue.

> Now, consider a separate per-window list of quad->quad mappings which
> define a piecewise projective transforamtion for each window. This would
> allow the X server to perform FixupEventForWindow without need to defer
> to a client.

This is a nice solution for piecewise quadrilinear renderings (which
will be at least a good approximation for most composition managers),
therefor this is an implementation that sounds pretty good to me.
However, if the general case should be mapped to this you easily get a
*lot* of quads for the mapping.

> Does it make sense to explore this server-resident redirection solution?

I think it is always worth to think about ideas that can reduce the
number of round trips.

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de



More information about the xorg mailing list