aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-27 08:37:02 +0200
committermarha <marha@users.sourceforge.net>2011-09-27 08:37:02 +0200
commit2233c44285f7e820f04abd07d6cf5eedbe32b8a3 (patch)
tree80d64c8daf68c57aaf3b6937cbd075161deaa3d2 /xorg-server/dix/devices.c
parent95acf9816e008fa46a6c2fa2f35500deb358bb69 (diff)
parent183b7373f9919eeb5eb408f38578e01717b2cc10 (diff)
downloadvcxsrv-2233c44285f7e820f04abd07d6cf5eedbe32b8a3.tar.gz
vcxsrv-2233c44285f7e820f04abd07d6cf5eedbe32b8a3.tar.bz2
vcxsrv-2233c44285f7e820f04abd07d6cf5eedbe32b8a3.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/main/version.c xorg-server/include/globals.h xorg-server/mi/misprite.c xorg-server/mi/mivaltree.c xorg-server/os/utils.c
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index a6c1d507a..b6f7ea697 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2414,7 +2414,6 @@ int
AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
{
ScreenPtr screen;
- DeviceIntPtr oldmaster;
if (!dev || IsMaster(dev))
return BadDevice;
@@ -2433,7 +2432,6 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
free(dev->spriteInfo->sprite);
}
- oldmaster = GetMaster(dev, MASTER_ATTACHED);
dev->master = master;
/* If device is set to floating, we need to create a sprite for it,
@@ -2492,16 +2490,22 @@ GetPairedDevice(DeviceIntPtr dev)
/**
- * Returns the right master for the type of event needed. If the event is a
- * keyboard event.
- * This function may be called with a master device as argument. If so, the
- * returned master is either the device itself or the paired master device.
- * If dev is a floating slave device, NULL is returned.
+ * Returns the requested master for this device.
+ * The return values are:
+ * - MASTER_ATTACHED: the master for this device or NULL for a floating
+ * slave.
+ * - MASTER_KEYBOARD: the master keyboard for this device or NULL for a
+ * floating slave
+ * - MASTER_POINTER: the master keyboard for this device or NULL for a
+ * floating slave
+ * - POINTER_OR_FLOAT: the master pointer for this device or the device for
+ * a floating slave
+ * - KEYBOARD_OR_FLOAT: the master keyboard for this device or the device for
+ * a floating slave
*
- * @type ::MASTER_KEYBOARD or ::MASTER_POINTER or ::MASTER_ATTACHED
- * @return The requested master device. In the case of MASTER_ATTACHED, this
- * is the directly attached master to this device, regardless of the type.
- * Otherwise, it is either the master keyboard or pointer for this device.
+ * @param which ::MASTER_KEYBOARD or ::MASTER_POINTER, ::MASTER_ATTACHED,
+ * ::POINTER_OR_FLOAT or ::KEYBOARD_OR_FLOAT.
+ * @return The requested master device
*/
DeviceIntPtr
GetMaster(DeviceIntPtr dev, int which)
@@ -2510,12 +2514,15 @@ GetMaster(DeviceIntPtr dev, int which)
if (IsMaster(dev))
master = dev;
- else
+ else {
master = dev->master;
+ if (!master && (which == POINTER_OR_FLOAT || which == KEYBOARD_OR_FLOAT))
+ return dev;
+ }
if (master && which != MASTER_ATTACHED)
{
- if (which == MASTER_KEYBOARD)
+ if (which == MASTER_KEYBOARD || which == KEYBOARD_OR_FLOAT)
{
if (master->type != MASTER_KEYBOARD)
master = GetPairedDevice(master);