From c7eb27f3927ba9a36f9904938996f346cca33021 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 4 Mar 2009 18:45:09 +1000 Subject: [PATCH] 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 --- Xi/listdev.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/Xi/listdev.c b/Xi/listdev.c index 28554f3fe..925d0ecbf 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -320,7 +320,6 @@ int ProcXListInputDevices(ClientPtr client) { xListInputDevicesReply rep; - XIClientPtr pXIClient; int numdevs = 0; int namesize = 1; /* need 1 extra byte for strcpy */ int rc, size = 0; @@ -340,21 +339,15 @@ ProcXListInputDevices(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; - pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); AddOtherInputDevices(); 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.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); if (rc != Success) return rc; @@ -363,10 +356,10 @@ ProcXListInputDevices(ClientPtr client) } for (d = inputInfo.off_devices; d; d = d->next) { - if (pXIClient->major_version < XI_2_Major && - !d->isMaster && - d->u.master) /* XXX can off_devices be attached? */ - continue; /* don't send attached SDs */ + if (d->isMaster && + d != inputInfo.pointer && + d != inputInfo.keyboard) + continue; /* don't send master devices other than VCP/VCK */ rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess); if (rc != Success) @@ -384,25 +377,20 @@ ProcXListInputDevices(ClientPtr client) dev = (xDeviceInfoPtr) devbuf; for (d = inputInfo.devices; d; d = d->next) { - if (pXIClient->major_version < XI_2_Major) - { - if (d->isMaster && - d != inputInfo.pointer && - d != inputInfo.keyboard) - continue; /* don't count master devices other than VCP/VCK */ + if (d->isMaster && + d != inputInfo.pointer && + d != inputInfo.keyboard) + 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); } for (d = inputInfo.off_devices; d; d = d->next) { - if (pXIClient->major_version < XI_2_Major && - !d->isMaster && - d->u.master) /* XXX can off_devices be attached? */ - continue; /* don't send attached SDs */ + if (d->isMaster && + d != inputInfo.pointer && + d != inputInfo.keyboard) + continue; /* don't count master devices other than VCP/VCK */ ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf); }