[PATCH] dix: When attaching a device, set CoreEvents to TRUE.

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 17 16:46:56 PST 2009


Floating devices can't send core events anyway. Attached devices only send
core events through the master device.
Master devices can be configured with core events off though that is a
rather special usecase.

The server behaviour is that devices listed with core events off in the
config file are floating by default. Without this patch, such a device
attached to a master device lateron will cause the master to send core
events but not actually move the pointer.

Reported-by; Benjamin Tissoires <tissoire at cena.fr>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/devices.c  |    2 ++
 mi/mipointer.c |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
index 6329d28..13fc0c2 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2366,11 +2366,13 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         InitializeSprite(dev, currentRoot);
         dev->spriteInfo->spriteOwner = FALSE;
         dev->spriteInfo->paired = dev;
+        dev->coreEvents = FALSE;
     } else
     {
         dev->spriteInfo->sprite = master->spriteInfo->sprite;
         dev->spriteInfo->paired = master;
         dev->spriteInfo->spriteOwner = FALSE;
+        dev->coreEvents = TRUE;
 
         RecalculateMasterButtons(master);
     }
diff --git a/mi/mipointer.c b/mi/mipointer.c
index e1f63be..59fd978 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -362,7 +362,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
     int			x, y, devx, devy;
     miPointerPtr        pPointer;
 
-    if (!pDev || !pDev->coreEvents)
+    if (!pDev || IsMaster(pDev) ? !pDev->coreEvents : !GetMaster(pDev, MASTER_POINTER))
         return;
 
     pPointer = MIPOINTER(pDev);
@@ -502,7 +502,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
     if (!pScreen)
 	return;	    /* called before ready */
 
-    if (!pDev || !pDev->coreEvents)
+    if (!pDev || IsMaster(pDev) ? !pDev->coreEvents : !GetMaster(pDev, MASTER_POINTER))
         return;
 
     if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
-- 
1.6.5.2



More information about the xorg-devel mailing list