From 18e51911f5748f9a27a18cd6bb421c899f5b048f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 17 Jan 2009 13:44:47 +0200 Subject: [PATCH] Input: Add postdown to ButtonClassRec This mirrors that in KeyClassRec: the state of the buttons as posted to GetPointerEvents, rather than the state of the buttons as processed by ProcessOtherEvent and friends. Signed-off-by: Daniel Stone Signed-off-by: Peter Hutterer --- dix/getevents.c | 8 ++++++-- include/inputstr.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index ee08bed49..ce086d524 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1006,10 +1006,14 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, kbp->type = DeviceMotionNotify; } else { - if (type == ButtonPress) + if (type == ButtonPress) { kbp->type = DeviceButtonPress; - else if (type == ButtonRelease) + pDev->button->postdown[buttons >> 3] |= (1 << (buttons & 7)); + } + else if (type == ButtonRelease) { kbp->type = DeviceButtonRelease; + pDev->button->postdown[buttons >> 3] &= ~(1 << (buttons & 7)); + } kbp->detail = buttons; } diff --git a/include/inputstr.h b/include/inputstr.h index daee7ed32..2ee4f9be3 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -181,6 +181,7 @@ typedef struct _ButtonClassRec { unsigned short state; Mask motionMask; CARD8 down[DOWN_LENGTH]; + CARD8 postdown[DOWN_LENGTH]; CARD8 map[MAP_LENGTH]; union _XkbAction *xkb_acts; } ButtonClassRec, *ButtonClassPtr;