summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-20 15:28:16 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-22 15:44:50 +1000
commitb12d302df8283186ce87882c29b2b0294adb2770 (patch)
tree7b2f4ce175d1a1aec64a354b922429b50dcc8bde /hw/xfree86
parentadd2defac7e59dcb355e5ba12b6de60861741d57 (diff)
Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev).
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/xf86Xinput.c4
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 6df0b8af2..39186ac9f 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -323,7 +323,7 @@ xf86ActivateDevice(LocalDevicePtr local)
local->dev = dev;
dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
- dev->isMaster = FALSE;
+ dev->type = SLAVE;
dev->spriteInfo->spriteOwner = FALSE;
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
@@ -664,7 +664,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
InputDriverPtr drv = NULL;
IDevRec *idev = NULL;
IDevPtr *it;
- Bool isMaster = pDev->isMaster;
+ Bool isMaster = IsMaster(pDev);
if (pInfo) /* need to get these before RemoveDevice */
{
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 2b73b1698..b86655031 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -315,7 +315,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
/* only update for VCP, otherwise we get cursor jumps when removing a
sprite. The second cursor is never HW rendered anyway. */
if (pDev == inputInfo.pointer ||
- (!pDev->isMaster && pDev->u.master == inputInfo.pointer))
+ (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
{
ScreenPriv->CurrentCursor = pCurs;
ScreenPriv->x = x;
@@ -380,7 +380,7 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
/* only update coordinate state for first sprite, otherwise we get jumps
when removing a sprite. The second sprite is never HW rendered anyway */
if (pDev == inputInfo.pointer ||
- (!pDev->isMaster && pDev->u.master == inputInfo.pointer))
+ (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
{
ScreenPriv->x = x;
ScreenPriv->y = y;