input: store the master device's ID in the devPrivate for XTest devices.

Rather than storing a simple boolean in the devPrivate for XTest devices,
store the actual master device's id (since it is constant for the life of
the device anyway).

Callers should use GetXtstDevice now instead of digging around in the
devPrivates themselves.

This patch allows for a cleanup in the creation of new master devices since
GetMaster and GetXtstDevice spare the need for loops, IsPointer checks and
similar.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
This commit is contained in:
Peter Hutterer 2009-06-23 10:50:52 +10:00
commit 0814f511d5
4 changed files with 64 additions and 77 deletions

View file

@ -56,7 +56,6 @@
extern int DeviceValuator;
extern int DeviceMotionNotify;
extern DevPrivateKey XTstDevicePrivateKey;
#ifdef PANORAMIX
#include "panoramiX.h"
@ -299,14 +298,7 @@ ProcXTestFakeInput(ClientPtr client)
return BadValue;
}
/* When faking core events through XTest, we always fake through the
* virtual test device.
*/
for(it = inputInfo.devices; it ; it = it->next )
if( !IsMaster(it) && it->u.master == dev &&
dixLookupPrivate(&it->devPrivates, XTstDevicePrivateKey ))
break;
dev= it;
dev = GetXtstDevice(dev);
}
/* If the event has a time set, wait for it to pass */