From 18413f55089623123537c1499b02aa95ca2014d2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 3 Mar 2011 14:15:55 +1000 Subject: [PATCH] xfree86: block signals between EnableDevice and first CheckMotion() Devices usually enable SIGIO processing in EnableDevice. CheckMotion initialises the pointer sprite, sends Enter/Leave events, etc. This leaves us with a small window where events may be processed without the sprite or pointer position (as seen from the protocol) is valid. Block signals during this window. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- hw/xfree86/common/xf86Xinput.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 74365e10b..e3264e6a9 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -817,15 +817,18 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) { + OsBlockSignals(); EnableDevice(dev, TRUE); if (!dev->enabled) { + OsReleaseSignals(); xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); rval = BadMatch; goto unwind; } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); + OsReleaseSignals(); } *pdev = dev;