minor input cleanups or optimizations

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 9 22:03:04 PDT 2010


On Wed, Aug 04, 2010 at 02:23:01PM -0700, Jamey Sharp wrote:
> I found the spriteTrace and focus trace arrays weird and confusing, so I
> put some thought into killing them with minimal performance impact. I
> haven't managed to do that, but I did find some code improvements along
> the way. Those follow. Peter, please pull these into your input-next
> tree if you like them.

thanks, they looked good to me until
./../dix/events.c: In function ‘CheckDeviceGrabs’:
./../dix/events.c:3638: error: ‘checkFirst’ undeclared (first use in this
function)
./../dix/events.c:3638: error: (Each undeclared identifier is reported only
once
./../dix/events.c:3638: error: for each function it appears in.)

I couldn't see anything obviously wrong with them and I did try to reproduce
the changed if conditions on paper. I'm guessing the above is just a bad
rebase but I'd appreciate it if you could fix this and test again.

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

> CheckDeviceGrabs currently walks down the window hierarchy from the
> root to the window containing the pointer, or for keyboard events to the
> focus window if that's nested deeper, and activates the first passive
> grab it finds along the way. I think it should be possible to walk
> upward instead, activating the last passive grab found. Then we only
> need to cache the window that contains the pointer, not any of its
> ancestors, so the storage requirement is constant instead of
> proportional to the depth of the window hierarchy.
> 
> Is that insane and/or impossible? So far all I can tell is I haven't got
> it right yet.

I don't think it's impossible though as you've noticed the current grab code
could serve as an advertisement for a pasta maker. there are always
side-effects and they're hard to track down and not easy to test. especially
grab replaying on thawing devices.

but in principle - yes, should be possible.

Cheers,
  Peter

> 
> The following changes since commit 7e0575baf14ec4a89492fd2780f9ab5b9244afbd:
>   Matt Turner (1):
>         ddc: Fix memory leak in GetEDID_DDC1
> 
> are available in the git repository at:
> 
>   git://people.freedesktop.org/~jamey/xserver input
> 
> Jamey Sharp (4):
>       Let CheckPassiveGrabsOnWindow callers check if device is already grabbed.
>       CheckDeviceGrabs: Delete redundant pWin->optional test.
>       Move replay-window check from ComputeFreezes to CheckDeviceGrabs.
>       Use GetCurrentRootWindow or equivalent instead of spriteTrace[0].
> 
>  dix/devices.c    |    2 +-
>  dix/enterleave.c |   13 +++------
>  dix/events.c     |   73 +++++++++++++++++++++++------------------------------
>  include/dix.h    |    2 +-
>  4 files changed, 38 insertions(+), 52 deletions(-)


More information about the xorg-devel mailing list