Xi: always only list VCP/VCK and the SD's in XListInputDevices.
If a client wants other MDs, it should use XI2's XQueryDevice() instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
801f14d4b7
commit
c7eb27f392
28
Xi/listdev.c
28
Xi/listdev.c
|
@ -320,7 +320,6 @@ int
|
||||||
ProcXListInputDevices(ClientPtr client)
|
ProcXListInputDevices(ClientPtr client)
|
||||||
{
|
{
|
||||||
xListInputDevicesReply rep;
|
xListInputDevicesReply rep;
|
||||||
XIClientPtr pXIClient;
|
|
||||||
int numdevs = 0;
|
int numdevs = 0;
|
||||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||||
int rc, size = 0;
|
int rc, size = 0;
|
||||||
|
@ -340,21 +339,15 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
|
|
||||||
|
|
||||||
AddOtherInputDevices();
|
AddOtherInputDevices();
|
||||||
|
|
||||||
for (d = inputInfo.devices; d; d = d->next) {
|
for (d = inputInfo.devices; d; d = d->next) {
|
||||||
if (pXIClient->major_version < XI_2_Major)
|
|
||||||
{
|
|
||||||
if (d->isMaster &&
|
if (d->isMaster &&
|
||||||
d != inputInfo.pointer &&
|
d != inputInfo.pointer &&
|
||||||
d != inputInfo.keyboard)
|
d != inputInfo.keyboard)
|
||||||
continue; /* don't send master devices other than VCP/VCK */
|
continue; /* don't send master devices other than VCP/VCK */
|
||||||
|
|
||||||
if (!d->isMaster && d->u.master)
|
|
||||||
continue; /* don't send attached SDs */
|
|
||||||
}
|
|
||||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -363,10 +356,10 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (d = inputInfo.off_devices; d; d = d->next) {
|
for (d = inputInfo.off_devices; d; d = d->next) {
|
||||||
if (pXIClient->major_version < XI_2_Major &&
|
if (d->isMaster &&
|
||||||
!d->isMaster &&
|
d != inputInfo.pointer &&
|
||||||
d->u.master) /* XXX can off_devices be attached? */
|
d != inputInfo.keyboard)
|
||||||
continue; /* don't send attached SDs */
|
continue; /* don't send master devices other than VCP/VCK */
|
||||||
|
|
||||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
@ -383,26 +376,21 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
|
|
||||||
dev = (xDeviceInfoPtr) devbuf;
|
dev = (xDeviceInfoPtr) devbuf;
|
||||||
for (d = inputInfo.devices; d; d = d->next)
|
for (d = inputInfo.devices; d; d = d->next)
|
||||||
{
|
|
||||||
if (pXIClient->major_version < XI_2_Major)
|
|
||||||
{
|
{
|
||||||
if (d->isMaster &&
|
if (d->isMaster &&
|
||||||
d != inputInfo.pointer &&
|
d != inputInfo.pointer &&
|
||||||
d != inputInfo.keyboard)
|
d != inputInfo.keyboard)
|
||||||
continue; /* don't count master devices other than VCP/VCK */
|
continue; /* don't count master devices other than VCP/VCK */
|
||||||
|
|
||||||
if (!d->isMaster && d->u.master)
|
|
||||||
continue; /* don't count attached SDs */
|
|
||||||
}
|
|
||||||
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (d = inputInfo.off_devices; d; d = d->next)
|
for (d = inputInfo.off_devices; d; d = d->next)
|
||||||
{
|
{
|
||||||
if (pXIClient->major_version < XI_2_Major &&
|
if (d->isMaster &&
|
||||||
!d->isMaster &&
|
d != inputInfo.pointer &&
|
||||||
d->u.master) /* XXX can off_devices be attached? */
|
d != inputInfo.keyboard)
|
||||||
continue; /* don't send attached SDs */
|
continue; /* don't count master devices other than VCP/VCK */
|
||||||
|
|
||||||
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue