diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-06 15:50:05 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-12 11:03:29 +1000 |
commit | da724e8f1d1867c36c9550a153c58829939800fc (patch) | |
tree | 90e7d14af5c9a9a23017a614bfc2dec81b382f76 /Xi/exevents.c | |
parent | b368dd1720c708aaec492b4a67fb7e4f87569c11 (diff) |
Xi: Set the button state on the event during POE.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/exevents.c')
-rw-r--r-- | Xi/exevents.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 20e0fbbfa..456e0791f 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -885,7 +885,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) KeyClassPtr k; ValuatorClassPtr v; int ret = 0; - int state; + int state, i; DeviceIntPtr mouse = NULL, kbd = NULL; DeviceEvent *event = (DeviceEvent*)ev; @@ -907,11 +907,14 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) state = (kbd) ? XkbStateFieldFromRec(&kbd->key->xkbInfo->state) : 0; state |= (mouse) ? (mouse->button->state) : 0; + for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) + if (BitIsOn(mouse->button->down, i)) + SetBit(event->buttons, i); + ret = UpdateDeviceState(device, event); if (ret == DONT_PROCESS) return; - v = device->valuator; b = device->button; k = device->key; |