[PATCH] xfree86: block signals between EnableDevice and first CheckMotion()

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 7 17:18:50 PST 2011


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 <peter.hutterer at who-t.net>
---
 hw/xfree86/common/xf86Xinput.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 74365e1..e3264e6 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;
-- 
1.7.4



More information about the xorg-devel mailing list