summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-09-08 09:55:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-09 10:31:23 +1000
commit97e3f4316b1c917f93d324f05d3a4551c1d051a3 (patch)
tree3cd775cc97023d707725f02735a39e88b49e982a
parent447bd4ce90113037a489ce55d9878523fe5294c7 (diff)
dix: auto-float SD's with SendCoreEvents "false"
AlwaysCore and SendCoreEvents specify whether a device is to send core events. A device that has either disabled is not supposed to send core events. With MPX/XI2, a device that is attached automatically sends core events when the event is routed through the master device. Floating a slave device disables core events by breaking the route. This patch automatically floats devices that have coreEvents disabled in the xorg.conf/HAL. This replicates the behaviour of a SendCoreEvents "false" device in server 1.6 and earlier. The devices may still be reattached to a master at runtime. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/devices.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 97bb7dfe4..dbd1b4ef5 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -312,8 +312,11 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
PairDevices(NULL, other, dev);
} else
{
- other = (IsPointerDevice(dev)) ? inputInfo.pointer :
- inputInfo.keyboard;
+ if (dev->coreEvents)
+ other = (IsPointerDevice(dev)) ? inputInfo.pointer :
+ inputInfo.keyboard;
+ else
+ other = NULL; /* auto-float non-core devices */
AttachDevice(NULL, dev, other);
}
}
@@ -2335,7 +2338,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
return BadDevice;
/* set from floating to floating? */
- if (!dev->u.master && !master)
+ if (!dev->u.master && !master && dev->enabled)
return Success;
/* free the existing sprite. */
@@ -2357,7 +2360,13 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
*/
if (!master)
{
- WindowPtr currentRoot = dev->spriteInfo->sprite->spriteTrace[0];
+ WindowPtr currentRoot;
+
+ if (dev->spriteInfo->sprite)
+ currentRoot = dev->spriteInfo->sprite->spriteTrace[0];
+ else /* new device auto-set to floating */
+ currentRoot = WindowTable[0];
+
/* we need to init a fake sprite */
screen = currentRoot->drawable.pScreen;
screen->DeviceCursorInitialize(dev, screen);