Deliver correct event when releasing keys on VT switch.

In commit 41bb9fce47, the event delivery loop
for Xinput enabled keyboards was changed and accidentally used the wrong
index variable, causing random events to be delivered when returning from VT
switch.

In addition, in commit aeba855b07,
SIGIO was blocked during delivery of these events, but not for the entire
period the xf86Events array was being used. Block SIGIO for the whole loop
to avoid other event delivery from trashing the key release events.
This commit is contained in:
Keith Packard 2007-09-05 14:19:19 -07:00
parent 643a263f2c
commit aa7ed1f5f3

View File

@ -811,9 +811,11 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
(*pDev->public.processInputProc) (&ke, pDev, 1);
}
else {
int sigstate = xf86BlockSIGIO ();
nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i);
for (j = 0; j < nevents; j++)
EqEnqueue(pDev, xf86Events + i);
mieqEnqueue(pDev, xf86Events + j);
xf86UnblockSIGIO(sigstate);
}
break;
}