From aa7ed1f5f35cd043bc38d985500aa0a32e857e84 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 5 Sep 2007 14:19:19 -0700 Subject: [PATCH] Deliver correct event when releasing keys on VT switch. In commit 41bb9fce47f6366cc3f7d45790f7883f74289b5a, 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 aeba855b07832354f59678e20cc29a085e42bd99, 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. --- hw/xfree86/common/xf86Events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index dd9c34e5c..91964c950 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -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; }