dix: add KEYBOARD_OR_FLOAT and POINTER_OR_FLOAT to GetMaster()

GetMaster() currently requires an attached slave device as parameter,
resuling in many calls being IsFloating(dev) ? dev : GetMaster(...);

Add two new parameters so GetMaster can be called unconditionally to get the
right device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Peter Hutterer 2011-08-01 13:52:13 +10:00
commit 98fe735ea1
3 changed files with 37 additions and 12 deletions

View file

@ -472,7 +472,10 @@ typedef struct _SpriteInfoRec {
#define MASTER_POINTER 1
#define MASTER_KEYBOARD 2
#define SLAVE 3
#define MASTER_ATTACHED 4 /* special type for GetMaster */
/* special types for GetMaster */
#define MASTER_ATTACHED 4 /* Master for this device */
#define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */
#define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */
typedef struct _DeviceIntRec {
DeviceRec public;