Mouse un-plug crashy fun

Keith Packard keithp at keithp.com
Mon Jul 21 11:48:24 PDT 2008


Unplug a mouse, then warp the pointer and the warp pointer code will try
to update the position of the last slave device associated with the
master. That pointer will be stale and the X server will crash.

Does this seem like a sensible fix?

diff --git a/dix/devices.c b/dix/devices.c
index 0a68c0e..82bcc64 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -315,6 +315,14 @@ DisableDevice(DeviceIntPtr dev)
                 AttachDevice(NULL, other, NULL);
         }
     }
+    else
+    {
+        for (other = inputInfo.devices; other; other = other->next)
+        {
+	    if (other->isMaster && other->u.lastSlave == dev)
+		other->u.lastSlave = NULL;
+	}
+    }
 
     if (dev->isMaster && dev->spriteInfo->sprite)
     {

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080721/bdf04171/attachment.pgp>


More information about the xorg mailing list