dix: Set bidirectional pairing, don't allow pairing with already paired devs.
This commit is contained in:
parent
70efd3d06a
commit
38baac71bd
|
@ -2238,7 +2238,10 @@ PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
/* Don't allow pairing for slave devices */
|
/* Don't allow pairing for slave devices */
|
||||||
if (ptr->master || kbd->master)
|
if (!ptr->isMaster || !kbd->isMaster)
|
||||||
|
return BadDevice;
|
||||||
|
|
||||||
|
if (ptr->spriteInfo->paired)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
if (!pairingClient)
|
if (!pairingClient)
|
||||||
|
@ -2255,6 +2258,7 @@ PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
|
||||||
|
|
||||||
kbd->spriteInfo->sprite = ptr->spriteInfo->sprite;
|
kbd->spriteInfo->sprite = ptr->spriteInfo->sprite;
|
||||||
kbd->spriteInfo->paired = ptr;
|
kbd->spriteInfo->paired = ptr;
|
||||||
|
ptr->spriteInfo->paired = kbd;
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue