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>
This commit is contained in:
parent
447bd4ce90
commit
97e3f4316b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user