summaryrefslogtreecommitdiff
path: root/mi
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 /mi
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 'mi')
-rw-r--r--mi/mieq.c4
-rw-r--r--mi/mipointer.c10
-rw-r--r--mi/misprite.c14
3 files changed, 14 insertions, 14 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 4b3d700ea..e2f18e2af 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -359,7 +359,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
NewCurrentScreen (dev, DequeueScreen(dev), x, y);
}
else {
- master = (!dev->isMaster && dev->u.master) ? dev->u.master : NULL;
+ master = (!IsMaster(dev) && dev->u.master) ? dev->u.master : NULL;
if (master)
CopyGetMasterEvent(master, dev, event, masterEvents);
@@ -426,7 +426,7 @@ mieqProcessInputEvents(void)
pthread_mutex_unlock(&miEventQueueMutex);
#endif
- master = (!dev->isMaster && dev->u.master) ? dev->u.master : NULL;
+ master = (!IsMaster(dev) && dev->u.master) ? dev->u.master : NULL;
if (screenIsSaved == SCREEN_SAVER_ON)
dixSaveScreens (serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
diff --git a/mi/mipointer.c b/mi/mipointer.c
index c75c120ec..fdad77b7c 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -51,7 +51,7 @@ static int miPointerPrivKeyIndex;
static DevPrivateKey miPointerPrivKey = &miPointerPrivKeyIndex;
#define MIPOINTER(dev) \
- ((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \
+ ((DevHasCursor((dev)) || (!IsMaster(isMaster) && !dev->u.master)) ? \
(miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
(miPointerPtr)dixLookupPrivate(&(dev)->u.master->devPrivates, miPointerPrivKey))
@@ -186,8 +186,8 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
miPointerPtr pPointer;
/* return for keyboards */
- if ((pDev->isMaster && !DevHasCursor(pDev)) ||
- (!pDev->isMaster && pDev->u.master && !DevHasCursor(pDev->u.master)))
+ if ((IsMaster(pDev) && !DevHasCursor(pDev)) ||
+ (!IsMaster(pDev) && pDev->u.master && !DevHasCursor(pDev->u.master)))
return FALSE;
pPointer = MIPOINTER(pDev);
@@ -286,7 +286,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
SetupScreen(pScreen);
- if (!pDev->isMaster && pDev->u.master)
+ if (!IsMaster(pDev) && pDev->u.master)
return;
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen);
@@ -474,7 +474,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
* VCP, as this may cause a non-HW rendered cursor to be rendered during
* SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT.
*/
- if ((pDev == inputInfo.pointer || (!pDev->isMaster && pDev->u.master == inputInfo.pointer))
+ if ((pDev == inputInfo.pointer || (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
&& !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
{
pPointer->devx = x;
diff --git a/mi/misprite.c b/mi/misprite.c
index a2abbc222..3f4c573e3 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -764,7 +764,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
miCursorInfoPtr pCursorInfo;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteRealizeCursor called for floating device.\n");
return FALSE;
@@ -795,7 +795,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteSetCursor called for floating device.\n");
return;
@@ -912,7 +912,7 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
CursorPtr pCursor;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteMoveCursor called for floating device.\n");
return;
@@ -980,7 +980,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
miCursorInfoPtr pCursorInfo;
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteRemoveCursor called for floating device.\n");
return;
@@ -1020,7 +1020,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteSaveUnderCursor called for floating device.\n");
return;
@@ -1063,7 +1063,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteRestoreCursor called for floating device.\n");
return;
@@ -1107,7 +1107,7 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
- if (!pDev->isMaster && !pDev->u.master)
+ if (!IsMaster(pDev) && !pDev->u.master)
{
ErrorF("[mi] miSpriteComputeSaved called for floating device.\n");
return;