dix: PairDevices() can be static, remove from input.
PairDevices() is only ever called in EnableDevice().
This commit is contained in:
parent
b6b26560d6
commit
eb014021c2
|
@ -128,6 +128,38 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
|
|||
return Success;
|
||||
}
|
||||
|
||||
/* Pair the keyboard to the pointer device. Keyboard events will follow the
|
||||
* pointer sprite. Only applicable for master devices.
|
||||
* If the client is set, the request to pair comes from some client. In this
|
||||
* case, we need to check for access. If the client is NULL, it's from an
|
||||
* internal automatic pairing, we must always permit this.
|
||||
*/
|
||||
static int
|
||||
PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
|
||||
{
|
||||
if (!ptr)
|
||||
return BadDevice;
|
||||
|
||||
/* Don't allow pairing for slave devices */
|
||||
if (!ptr->isMaster || !kbd->isMaster)
|
||||
return BadDevice;
|
||||
|
||||
if (ptr->spriteInfo->paired)
|
||||
return BadDevice;
|
||||
|
||||
if (kbd->spriteInfo->spriteOwner)
|
||||
{
|
||||
xfree(kbd->spriteInfo->sprite);
|
||||
kbd->spriteInfo->sprite = NULL;
|
||||
kbd->spriteInfo->spriteOwner = FALSE;
|
||||
}
|
||||
|
||||
kbd->spriteInfo->sprite = ptr->spriteInfo->sprite;
|
||||
kbd->spriteInfo->paired = ptr;
|
||||
ptr->spriteInfo->paired = kbd;
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2462,38 +2494,6 @@ ProcQueryKeymap(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
/* Pair the keyboard to the pointer device. Keyboard events will follow the
|
||||
* pointer sprite. Only applicable for master devices.
|
||||
* If the client is set, the request to pair comes from some client. In this
|
||||
* case, we need to check for access. If the client is NULL, it's from an
|
||||
* internal automatic pairing, we must always permit this.
|
||||
*/
|
||||
int
|
||||
PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
|
||||
{
|
||||
if (!ptr)
|
||||
return BadDevice;
|
||||
|
||||
/* Don't allow pairing for slave devices */
|
||||
if (!ptr->isMaster || !kbd->isMaster)
|
||||
return BadDevice;
|
||||
|
||||
if (ptr->spriteInfo->paired)
|
||||
return BadDevice;
|
||||
|
||||
if (kbd->spriteInfo->spriteOwner)
|
||||
{
|
||||
xfree(kbd->spriteInfo->sprite);
|
||||
kbd->spriteInfo->sprite = NULL;
|
||||
kbd->spriteInfo->spriteOwner = FALSE;
|
||||
}
|
||||
|
||||
kbd->spriteInfo->sprite = ptr->spriteInfo->sprite;
|
||||
kbd->spriteInfo->paired = ptr;
|
||||
ptr->spriteInfo->paired = kbd;
|
||||
return Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach device 'dev' to device 'master'.
|
||||
* Client is set to the client that issued the request, or NULL if it comes
|
||||
|
|
|
@ -512,10 +512,6 @@ extern int GetMotionHistory(
|
|||
|
||||
extern void SwitchCorePointer(DeviceIntPtr pDev);
|
||||
|
||||
/* Pairing input devices */
|
||||
extern int PairDevices(ClientPtr client,
|
||||
DeviceIntPtr pointer,
|
||||
DeviceIntPtr keyboard);
|
||||
extern int AttachDevice(ClientPtr client,
|
||||
DeviceIntPtr slave,
|
||||
DeviceIntPtr master);
|
||||
|
|
Loading…
Reference in New Issue
Block a user