minor input cleanups or optimizations

Jamey Sharp jamey at minilop.net
Wed Aug 4 14:23:01 PDT 2010


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.

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.

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(-)

Jamey


More information about the xorg-devel mailing list