diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-08-21 16:38:53 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-04 12:59:43 +1000 |
commit | 219ae5b628f9ffe2be0876d5911cc04e52bef5f8 (patch) | |
tree | 7b1ed0df6ad05ebf9ae4a7f14d4027e9c6117f24 /dix/events.c | |
parent | bfb219f532f3c78ba905424365ee7c5f7b5f21a2 (diff) |
dix: hide the sequenceNumber key repeat hack behind two functions.
Just in case we figure out a better way to do it in the future.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/events.c')
-rw-r--r-- | dix/events.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dix/events.c b/dix/events.c index 62eb6c225..90a2675c4 100644 --- a/dix/events.c +++ b/dix/events.c @@ -226,6 +226,9 @@ static Bool CheckPassiveGrabsOnWindow(WindowPtr pWin, DeviceEvent *event, BOOL checkCore); +/** Key repeat hack. Do not use but in TryClientEvents */ +extern BOOL EventIsKeyRepeat(xEvent *event); + /** * Main input device struct. * inputInfo.pointer @@ -1948,8 +1951,7 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, return 1; } else if (type == KeyPress) { - /* sequenceNumber == 1 if autorepeat is set */ - if (pEvents->u.u.sequenceNumber) + if (EventIsKeyRepeat(pEvents)) { if (!_XkbWantsDetectableAutoRepeat(client)) { @@ -1970,7 +1972,7 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, } else if (type == DeviceKeyPress) { - if (((deviceKeyButtonPointer *)pEvents)->sequenceNumber) + if (EventIsKeyRepeat(pEvents)) { if (!_XkbWantsDetectableAutoRepeat(client)) { |