diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-22 23:25:20 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-22 23:25:20 +0930 |
commit | 1a3f351c50cba66f71a73239318174b09fd9b63b (patch) | |
tree | 9a87242575ae3943f97ade79ee8fed9ba22dbb3e | |
parent | e0fbe404a436aef24624a3a15e8405a9ca38aadb (diff) |
dix: when floating a device, create a new cursor sprite.
This is essentially necessary to allow calls to miPointerGetSprite etc. to
work for floating slave devices.
-rw-r--r-- | dix/devices.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c index 5606543f7..1b71a42be 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2415,6 +2415,7 @@ PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd) int AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) { + ScreenPtr screen; DeviceIntPtr oldmaster; if (!dev || dev->isMaster) return BadDevice; @@ -2428,7 +2429,11 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) /* free the existing sprite. */ if (!dev->u.master && dev->spriteInfo->paired == dev) + { + screen = miPointerGetScreen(dev); + screen->DeviceCursorCleanup(dev, screen); xfree(dev->spriteInfo->sprite); + } oldmaster = dev->u.master; dev->u.master = master; @@ -2442,10 +2447,14 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) if (!master) { WindowPtr currentRoot = dev->spriteInfo->sprite->spriteTrace[0]; + /* we need to init a fake sprite */ + screen = currentRoot->drawable.pScreen; + screen->DeviceCursorInitialize(dev, screen); dev->spriteInfo->sprite = NULL; InitializeSprite(dev, currentRoot); dev->spriteInfo->spriteOwner = FALSE; dev->spriteInfo->paired = dev; + } else { dev->spriteInfo->sprite = master->spriteInfo->sprite; |