Xi: Set the button state on the event during POE.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-03-06 15:50:05 +10:00
parent b368dd1720
commit da724e8f1d

View File

@ -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;