aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-27 08:26:50 +0200
committermarha <marha@users.sourceforge.net>2011-09-27 08:26:50 +0200
commit183b7373f9919eeb5eb408f38578e01717b2cc10 (patch)
tree216dcb7e4efb0d67d019a4abe0e58cc6e1fa58b8 /xorg-server/dix/devices.c
parent873965b49f283ad028dd4e0e5b7e93a758c84993 (diff)
downloadvcxsrv-183b7373f9919eeb5eb408f38578e01717b2cc10.tar.gz
vcxsrv-183b7373f9919eeb5eb408f38578e01717b2cc10.tar.bz2
vcxsrv-183b7373f9919eeb5eb408f38578e01717b2cc10.zip
libX11 pixman mesa xserver git update 27 sep 2011
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 0ccf25277..ab8a648a9 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2406,7 +2406,6 @@ int
AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
{
ScreenPtr screen;
- DeviceIntPtr oldmaster;
if (!dev || IsMaster(dev))
return BadDevice;
@@ -2425,7 +2424,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,
@@ -2484,16 +2482,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)
@@ -2502,12 +2506,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);