diff options
-rw-r--r-- | Xext/xtest.c | 2 | ||||
-rw-r--r-- | Xi/chdevhier.c | 20 | ||||
-rw-r--r-- | Xi/exevents.c | 10 | ||||
-rw-r--r-- | Xi/listdev.c | 12 | ||||
-rw-r--r-- | Xi/opendev.c | 2 | ||||
-rw-r--r-- | Xi/querydev.c | 10 | ||||
-rw-r--r-- | Xi/setcptr.c | 2 | ||||
-rw-r--r-- | Xi/xiallowev.c | 6 | ||||
-rw-r--r-- | Xi/xigrabdev.c | 2 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 6 | ||||
-rw-r--r-- | dix/devices.c | 52 | ||||
-rw-r--r-- | dix/enterleave.c | 4 | ||||
-rw-r--r-- | dix/events.c | 41 | ||||
-rw-r--r-- | dix/getevents.c | 8 | ||||
-rw-r--r-- | dix/inpututils.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 4 | ||||
-rw-r--r-- | hw/xfree86/ramdac/xf86Cursor.c | 4 | ||||
-rw-r--r-- | include/dix.h | 1 | ||||
-rw-r--r-- | include/inputstr.h | 7 | ||||
-rw-r--r-- | mi/mieq.c | 4 | ||||
-rw-r--r-- | mi/mipointer.c | 10 | ||||
-rw-r--r-- | mi/misprite.c | 14 | ||||
-rw-r--r-- | xkb/xkb.c | 32 |
23 files changed, 135 insertions, 122 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c index 96380b769..32abe2a81 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -303,7 +303,7 @@ ProcXTestFakeInput(ClientPtr client) * virtual test device. */ for(it = inputInfo.devices; it ; it = it->next ) - if( !it->isMaster && it->u.master == dev && + if( !IsMaster(it) && it->u.master == dev && dixLookupPrivate(&it->devPrivates, XTstDevicePrivateKey )) break; dev= it; diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c index e59bfab32..927df5569 100644 --- a/Xi/chdevhier.c +++ b/Xi/chdevhier.c @@ -243,7 +243,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) goto unwind; - if (!ptr->isMaster) + if (!IsMaster(ptr)) { client->errorValue = r->deviceid; rc = BadDevice; @@ -259,7 +259,7 @@ ProcXIChangeHierarchy(ClientPtr client) } for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !xtstdevice->isMaster && xtstdevice->u.master == ptr && + if( !IsMaster(xtstdevice) && xtstdevice->u.master == ptr && dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey )) break; @@ -296,7 +296,7 @@ ProcXIChangeHierarchy(ClientPtr client) { /* Search the matching keyboard */ for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !xtstdevice->isMaster && + if( !IsMaster(xtstdevice) && xtstdevice->u.master == keybd && IsKeyboardDevice(xtstdevice) && dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey )) @@ -315,7 +315,7 @@ ProcXIChangeHierarchy(ClientPtr client) xtstkeybd = xtstptr; /* Search the matching pointer */ for(xtstdevice = inputInfo.devices; xtstdevice ; xtstdevice = xtstdevice->next ) - if( !xtstdevice->isMaster && + if( !IsMaster(xtstdevice) && xtstdevice->u.master == ptr && IsPointerDevice(xtstdevice) && dixLookupPrivate(&xtstdevice->devPrivates, XTstDevicePrivateKey ) @@ -343,7 +343,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) goto unwind; - if (!newptr->isMaster) + if (!IsMaster(newptr)) { client->errorValue = r->return_pointer; rc = BadDevice; @@ -355,7 +355,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) goto unwind; - if (!newkeybd->isMaster) + if (!IsMaster(newkeybd)) { client->errorValue = r->return_keyboard; rc = BadDevice; @@ -366,7 +366,7 @@ ProcXIChangeHierarchy(ClientPtr client) attached; attached = attached->next) { - if (!attached->isMaster) { + if (!IsMaster(attached)) { if (attached->u.master == ptr) { AttachDevice(client, attached, newptr); @@ -418,7 +418,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) goto unwind; - if (ptr->isMaster) + if (IsMaster(ptr)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -451,7 +451,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) goto unwind; - if (ptr->isMaster) + if (IsMaster(ptr)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -473,7 +473,7 @@ ProcXIChangeHierarchy(ClientPtr client) client, DixWriteAccess); if (rc != Success) goto unwind; - if (!newmaster->isMaster) + if (!IsMaster(newmaster)) { client->errorValue = c->new_master; rc = BadDevice; diff --git a/Xi/exevents.c b/Xi/exevents.c index 04a4fbd0c..d7fb59935 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -721,7 +721,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) { DeviceIntPtr master = device->u.master; - if (device->isMaster) + if (IsMaster(device)) return; if (!master) /* if device was set floating between SIGIO and now */ @@ -866,7 +866,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) kptr = &b->down[key>>3]; if (!(*kptr & bit)) return DONT_PROCESS; - if (device->isMaster) { + if (IsMaster(device)) { DeviceIntPtr sd; /* @@ -875,7 +875,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) * event being delivered through the slave first */ for (sd = inputInfo.devices; sd; sd = sd->next) { - if (sd->isMaster || sd->u.master != device) + if (IsMaster(sd) || sd->u.master != device) continue; if (!sd->button) continue; @@ -1007,7 +1007,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) b = device->button; k = device->key; - if (device->isMaster || !device->u.master) + if (IsMaster(device) || !device->u.master) CheckMotion(event, device); switch (event->type) @@ -1201,7 +1201,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeviceIntPtr mouse; int btlen, len, i; - mouse = (dev->isMaster || dev->u.master) ? GetPairedDevice(dev) : NULL; + mouse = (IsMaster(dev) || dev->u.master) ? GetPairedDevice(dev) : NULL; /* XI 2 event */ btlen = (mouse->button) ? (mouse->button->numButtons + 7)/8 : 0; diff --git a/Xi/listdev.c b/Xi/listdev.c index 294fec999..95c1532b4 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -177,9 +177,9 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, dev->id = d->id; dev->type = d->xinput_type; dev->num_classes = num_classes; - if (d->isMaster && IsKeyboardDevice(d)) + if (IsMaster(d) && IsKeyboardDevice(d)) dev->use = IsXKeyboard; - else if (d->isMaster && IsPointerDevice(d)) + else if (IsMaster(d) && IsPointerDevice(d)) dev->use = IsXPointer; else if (d->key && d->kbdfeed) dev->use = IsXExtensionKeyboard; @@ -344,7 +344,7 @@ ProcXListInputDevices(ClientPtr client) AddOtherInputDevices(); for (d = inputInfo.devices; d; d = d->next) { - if (d->isMaster && + if (IsMaster(d) && d != inputInfo.pointer && d != inputInfo.keyboard) continue; /* don't send master devices other than VCP/VCK */ @@ -357,7 +357,7 @@ ProcXListInputDevices(ClientPtr client) } for (d = inputInfo.off_devices; d; d = d->next) { - if (d->isMaster && + if (IsMaster(d) && d != inputInfo.pointer && d != inputInfo.keyboard) continue; /* don't send master devices other than VCP/VCK */ @@ -378,7 +378,7 @@ ProcXListInputDevices(ClientPtr client) dev = (xDeviceInfoPtr) devbuf; for (d = inputInfo.devices; d; d = d->next) { - if (d->isMaster && + if (IsMaster(d) && d != inputInfo.pointer && d != inputInfo.keyboard) continue; /* don't count master devices other than VCP/VCK */ @@ -388,7 +388,7 @@ ProcXListInputDevices(ClientPtr client) for (d = inputInfo.off_devices; d; d = d->next) { - if (d->isMaster && + if (IsMaster(d) && d != inputInfo.pointer && d != inputInfo.keyboard) continue; /* don't count master devices other than VCP/VCK */ diff --git a/Xi/opendev.c b/Xi/opendev.c index 4ad5af297..46d55a820 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -112,7 +112,7 @@ ProcXOpenDevice(ClientPtr client) } else if (status != Success) return status; - if (dev->isMaster) + if (IsMaster(dev)) return BadDevice; OpenInputDevice(dev, client, &status); diff --git a/Xi/querydev.c b/Xi/querydev.c index b50d0382e..d881b7640 100644 --- a/Xi/querydev.c +++ b/Xi/querydev.c @@ -88,14 +88,14 @@ ProcXIQueryDevice(ClientPtr client) for (dev = inputInfo.devices; dev; dev = dev->next) { if (stuff->deviceid == XIAllDevices || - (stuff->deviceid == XIAllMasterDevices && dev->isMaster)) + (stuff->deviceid == XIAllMasterDevices && IsMaster(dev))) len += SizeDeviceInfo(dev); } for (dev = inputInfo.off_devices; dev; dev = dev->next) { if (stuff->deviceid == XIAllDevices || - (stuff->deviceid == XIAllMasterDevices && dev->isMaster)) + (stuff->deviceid == XIAllMasterDevices && IsMaster(dev))) len += SizeDeviceInfo(dev); } @@ -126,7 +126,7 @@ ProcXIQueryDevice(ClientPtr client) for (dev = inputInfo.devices; dev; dev = dev->next) { if (stuff->deviceid == XIAllDevices || - (stuff->deviceid == XIAllMasterDevices && dev->isMaster)) + (stuff->deviceid == XIAllMasterDevices && IsMaster(dev))) { len = ListDeviceInfo(dev, (xXIDeviceInfo*)info); if (client->swapped) @@ -139,7 +139,7 @@ ProcXIQueryDevice(ClientPtr client) for (dev = inputInfo.off_devices; dev; dev = dev->next) { if (stuff->deviceid == XIAllDevices || - (stuff->deviceid == XIAllMasterDevices && dev->isMaster)) + (stuff->deviceid == XIAllMasterDevices && IsMaster(dev))) { len = ListDeviceInfo(dev, (xXIDeviceInfo*)info); if (client->swapped) @@ -326,7 +326,7 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) DeviceIntPtr master = dev->u.master; int use; - if (dev->isMaster) + if (IsMaster(dev)) { DeviceIntPtr paired = GetPairedDevice(dev); use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard; diff --git a/Xi/setcptr.c b/Xi/setcptr.c index 46b88bf6d..0bfc1eab7 100644 --- a/Xi/setcptr.c +++ b/Xi/setcptr.c @@ -74,7 +74,7 @@ ProcXISetClientPointer(ClientPtr client) if (rc != Success) return rc; - if (!IsPointerDevice(pDev) || !pDev->isMaster) + if (!IsPointerDevice(pDev) || !IsMaster(pDev)) { client->errorValue = stuff->deviceid; return BadDevice; diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index 9eb36c42b..3077e1a44 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -82,15 +82,15 @@ ProcXIAllowEvents(ClientPtr client) AllowSome(client, time, dev, THAWED); break; case XIAsyncPairedDevice: - if (dev->isMaster) + if (IsMaster(dev)) AllowSome(client, time, dev, THAW_OTHERS); break; case XISyncPair: - if (dev->isMaster) + if (IsMaster(dev)) AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT); break; case XIAsyncPair: - if (dev->isMaster) + if (IsMaster(dev)) AllowSome(client, time, dev, THAWED_BOTH); break; default: diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 20f4e5167..95beb832b 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -74,7 +74,7 @@ ProcXIGrabDevice(ClientPtr client) if (ret != Success) return ret; - if (!dev->isMaster) + if (!IsMaster(dev)) stuff->paired_device_mode = GrabModeAsync; memset(mask.xi2mask, 0, sizeof(mask.xi2mask)); diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index d2dabba4f..3f46e6766 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -102,7 +102,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) } /* Can't grab for modifiers on an attached slave device */ - if (!dev->isMaster) + if (!IsMaster(dev)) { if (!dev->u.master) stuff->paired_device_mode = GrabModeAsync; @@ -157,7 +157,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (!modifiers_failed) return BadAlloc; - if (IsPointerDevice(dev) && dev->isMaster) + if (IsPointerDevice(dev) && IsMaster(dev)) mod_dev = GetPairedDevice(dev); else mod_dev = dev; @@ -261,7 +261,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client) if (rc != Success) return rc; - if (dev->isMaster) + if (IsMaster(dev)) mod_dev = GetPairedDevice(dev); else mod_dev = dev; diff --git a/dix/devices.c b/dix/devices.c index e7da2ad1d..3d0d30d29 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -152,7 +152,7 @@ PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd) return BadDevice; /* Don't allow pairing for slave devices */ - if (!ptr->isMaster || !kbd->isMaster) + if (!IsMaster(ptr) || !IsMaster(kbd)) return BadDevice; if (ptr->spriteInfo->paired) @@ -180,7 +180,7 @@ NextFreePointerDevice(void) { DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) - if (dev->isMaster && + if (IsMaster(dev) && dev->spriteInfo->spriteOwner && !dev->spriteInfo->paired) return dev; @@ -306,7 +306,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) if (!dev->spriteInfo->sprite) { - if (dev->isMaster) + if (IsMaster(dev)) { /* Sprites appear on first root window, so we can hardcode it */ if (dev->spriteInfo->spriteOwner) @@ -398,7 +398,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) return FALSE; /* float attached devices */ - if (dev->isMaster) + if (IsMaster(dev)) { for (other = inputInfo.devices; other; other = other->next) { @@ -413,12 +413,12 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) { for (other = inputInfo.devices; other; other = other->next) { - if (other->isMaster && other->u.lastSlave == dev) + if (IsMaster(other) && other->u.lastSlave == dev) other->u.lastSlave = NULL; } } - if (dev->isMaster && dev->spriteInfo->sprite) + if (IsMaster(dev) && dev->spriteInfo->sprite) { for (other = inputInfo.devices; other; other = other->next) { @@ -488,7 +488,7 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent) return ret; /* Initialize memory for sprites. */ - if (dev->isMaster && dev->spriteInfo->spriteOwner) + if (IsMaster(dev) && dev->spriteInfo->spriteOwner) pScreen->DeviceCursorInitialize(dev, pScreen); SendDevicePresenceEvent(dev->id, DeviceAdded); @@ -847,7 +847,7 @@ CloseDevice(DeviceIntPtr dev) (void)(*dev->deviceProc)(dev, DEVICE_CLOSE); /* free sprite memory */ - if (dev->isMaster && dev->spriteInfo->sprite) + if (IsMaster(dev) && dev->spriteInfo->sprite) screen->DeviceCursorCleanup(dev, screen); /* free acceleration info */ @@ -859,7 +859,7 @@ CloseDevice(DeviceIntPtr dev) classes = (ClassesPtr)&dev->key; FreeAllDeviceClasses(classes); - if (dev->isMaster) + if (IsMaster(dev)) { classes = dixLookupPrivate(&dev->devPrivates, UnusedClassesPrivateKey); FreeAllDeviceClasses(classes); @@ -904,7 +904,7 @@ CloseDownDevices(void) */ for (dev = inputInfo.devices; dev; dev = dev->next) { - if (!dev->isMaster && dev->u.master) + if (!IsMaster(dev) && dev->u.master) dev->u.master = NULL; } @@ -990,7 +990,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) else prev->next = next; - flags[tmp->id] = (tmp->isMaster) ? XIMasterRemoved : XISlaveRemoved; + flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); ret = Success; } @@ -1000,7 +1000,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) for (tmp = inputInfo.off_devices; tmp; (prev = tmp), (tmp = next)) { next = tmp->next; if (tmp == dev) { - flags[tmp->id] = (tmp->isMaster) ? XIMasterRemoved : XISlaveRemoved; + flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); if (prev == NULL) @@ -1194,7 +1194,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, } dev->last.numValuators = numAxes; - if(dev->isMaster) /* master devs do not accelerate */ + if(IsMaster(dev)) /* master devs do not accelerate */ InitPointerAccelerationScheme(dev, PtrAccelNoOp); else InitPointerAccelerationScheme(dev, PtrAccelDefault); @@ -1226,7 +1226,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, if(!val) return FALSE; - if(dev->isMaster && (scheme != PtrAccelNoOp)) + if(IsMaster(dev) && (scheme != PtrAccelNoOp)) scheme = PtrAccelNoOp; /* no accel for master devices */ for(x = 0; pointerAccelerationScheme[x].number >= 0; x++) { @@ -1587,7 +1587,7 @@ ProcChangeKeyboardMapping(ClientPtr client) stuff->keyCodes, NULL, client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if (tmp->isMaster || tmp->u.master != pDev) + if (IsMaster(tmp) || tmp->u.master != pDev) continue; if (!tmp->key) continue; @@ -1932,7 +1932,7 @@ ProcChangeKeyboardControl (ClientPtr client) keyboard = PickKeyboard(client); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { - if ((pDev == keyboard || (!pDev->isMaster && pDev->u.master == keyboard)) && + if ((pDev == keyboard || (!IsMaster(keyboard) && pDev->u.master == keyboard)) && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess); if (ret != Success) @@ -1941,7 +1941,7 @@ ProcChangeKeyboardControl (ClientPtr client) } for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { - if ((pDev == keyboard || (!pDev->isMaster && pDev->u.master == keyboard)) && + if ((pDev == keyboard || (!IsMaster(keyboard) && pDev->u.master == keyboard)) && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { ret = DoChangeKeyboardControl(client, pDev, vlist, vmask); if (ret != Success) @@ -2010,7 +2010,7 @@ ProcBell(ClientPtr client) newpercent = base - newpercent + stuff->percent; for (dev = inputInfo.devices; dev; dev = dev->next) { - if ((dev == keybd || (!dev->isMaster && dev->u.master == keybd)) && + if ((dev == keybd || (!IsMaster(dev) && dev->u.master == keybd)) && dev->kbdfeed && dev->kbdfeed->BellProc) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess); @@ -2082,7 +2082,7 @@ ProcChangePointerControl(ClientPtr client) } for (dev = inputInfo.devices; dev; dev = dev->next) { - if ((dev == mouse || (!dev->isMaster && dev->u.master == mouse)) && + if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) && dev->ptrfeed && dev->ptrfeed->CtrlProc) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess); if (rc != Success) @@ -2091,7 +2091,7 @@ ProcChangePointerControl(ClientPtr client) } for (dev = inputInfo.devices; dev; dev = dev->next) { - if ((dev == mouse || (!dev->isMaster && dev->u.master == mouse)) && + if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) && dev->ptrfeed && dev->ptrfeed->CtrlProc) { dev->ptrfeed->ctrl = ctrl; (*dev->ptrfeed->CtrlProc)(dev, &mouse->ptrfeed->ctrl); @@ -2246,10 +2246,10 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) { ScreenPtr screen; DeviceIntPtr oldmaster; - if (!dev || dev->isMaster) + if (!dev || IsMaster(dev)) return BadDevice; - if (master && !master->isMaster) /* can't attach to slaves */ + if (master && !IsMaster(master)) /* can't attach to slaves */ return BadDevice; /* set from floating to floating? */ @@ -2310,7 +2310,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) { DeviceIntPtr it; for (it = inputInfo.devices; it; it = it->next) - if (!it->isMaster && it->u.master == oldmaster) + if (!IsMaster(it) && it->u.master == oldmaster) break; if (!it) /* no dev is paired with old master */ @@ -2338,7 +2338,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) DeviceIntPtr GetPairedDevice(DeviceIntPtr dev) { - if (!dev->isMaster && dev->u.master) + if (!IsMaster(dev) && dev->u.master) dev = dev->u.master; return dev->spriteInfo->paired; @@ -2380,7 +2380,7 @@ AllocDevicePair (ClientPtr client, char* name, pointer->u.lastSlave = NULL; pointer->last.slave = NULL; - pointer->isMaster = master; + pointer->type = (master) ? MASTER_POINTER : SLAVE; keyboard = AddInputDevice(client, CoreKeyboardProc, TRUE); if (!keyboard) @@ -2403,7 +2403,7 @@ AllocDevicePair (ClientPtr client, char* name, keyboard->u.lastSlave = NULL; keyboard->last.slave = NULL; - keyboard->isMaster = master; + keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE; /* The ClassesRec stores the device classes currently not used. */ diff --git a/dix/enterleave.c b/dix/enterleave.c index e45d061d4..eadcc4558 100644 --- a/dix/enterleave.c +++ b/dix/enterleave.c @@ -546,7 +546,7 @@ CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr to, int mode) { - if (!dev->isMaster) + if (!IsMaster(dev)) return; LeaveWindow(dev, from, mode); @@ -1216,7 +1216,7 @@ CoreFocusEvents(DeviceIntPtr dev, WindowPtr to, int mode) { - if (!dev->isMaster) + if (!IsMaster(dev)) return; SetFocusOut(dev, from); diff --git a/dix/events.c b/dix/events.c index 10814fa25..3222950f7 100644 --- a/dix/events.c +++ b/dix/events.c @@ -329,7 +329,7 @@ DevHasCursor(DeviceIntPtr pDev) Bool IsPointerDevice(DeviceIntPtr dev) { - return (dev->valuator && dev->button); + return (dev->type == MASTER_POINTER) || (dev->valuator && dev->button); } /* @@ -342,7 +342,14 @@ IsPointerDevice(DeviceIntPtr dev) Bool IsKeyboardDevice(DeviceIntPtr dev) { - return (dev->key && dev->kbdfeed) && !IsPointerDevice(dev); + return (dev->type == MASTER_KEYBOARD) || + ((dev->key && dev->kbdfeed) && !IsPointerDevice(dev)); +} + +Bool +IsMaster(DeviceIntPtr dev) +{ + return (dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD); } static WindowPtr XYToWindow( @@ -455,7 +462,7 @@ GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev) return ((inputMasks->xi2mask[dev->id][evtype/8] & filter) || inputMasks->xi2mask[XIAllDevices][evtype/8] || - (inputMasks->xi2mask[XIAllMasterDevices][evtype/8] && dev->isMaster)); + (inputMasks->xi2mask[XIAllMasterDevices][evtype/8] && IsMaster(dev))); } static Mask @@ -467,7 +474,7 @@ GetEventMask(DeviceIntPtr dev, xEvent *event, InputClients* other) int byte = ((xGenericEvent*)event)->evtype / 8; return (other->xi2mask[dev->id][byte] | other->xi2mask[XIAllDevices][byte] | - (dev->isMaster? other->xi2mask[XIAllMasterDevices][byte] : 0)); + (IsMaster(dev)? other->xi2mask[XIAllMasterDevices][byte] : 0)); } else if (CORE_EVENT(event)) return other->mask[XIAllDevices]; else @@ -1404,7 +1411,7 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) The correct thing to do would be to freeze all SDs attached to the paired master device. */ - if (thisDev->isMaster) + if (IsMaster(thisDev)) { dev = GetPairedDevice(thisDev); if (otherMode == GrabModeSync) @@ -1453,7 +1460,7 @@ RestoreOldMaster(DeviceIntPtr dev) { GrabMemoryPtr gm; - if (dev->isMaster) + if (IsMaster(dev)) return; gm = (GrabMemoryPtr)dixLookupPrivate(&dev->devPrivates, GrabPrivateKey); @@ -1491,7 +1498,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, Bool isPassive = autoGrab & ~ImplicitGrabMask; /* slave devices need to float for the duration of the grab. */ - if (!isPassive && !mouse->isMaster) + if (!isPassive && !IsMaster(mouse)) { SaveOldMaster(mouse); AttachDevice(NULL, mouse, NULL); @@ -1569,7 +1576,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ - if (!passive && !keybd->isMaster) + if (!passive && !IsMaster(keybd)) { SaveOldMaster(keybd); AttachDevice(NULL, keybd, NULL); @@ -2311,7 +2318,7 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) filter = GetEventFilter(dev, &ev); if (type && (inputMasks = wOtherInputMasks(win)) && ((inputMasks->xi2mask[XIAllDevices][type/8] & filter) || - ((inputMasks->xi2mask[XIAllMasterDevices][type/8] & filter) && dev->isMaster) || + ((inputMasks->xi2mask[XIAllMasterDevices][type/8] & filter) && IsMaster(dev)) || (inputMasks->xi2mask[dev->id][type/8] & filter))) rc |= XI2_MASK; @@ -2430,7 +2437,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, } /* Core event */ - if ((mask & CORE_MASK) && dev->isMaster && dev->coreEvents) + if ((mask & CORE_MASK) && IsMaster(dev) && dev->coreEvents) { rc = EventToCore(event, &core); if (rc != Success) @@ -3160,7 +3167,7 @@ ProcWarpPointer(ClientPtr client) dev = PickPointer(client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if ((tmp == dev) || (!tmp->isMaster && tmp->u.master == dev)) { + if ((tmp == dev) || (!IsMaster(tmp) && tmp->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess); if (rc != Success) return rc; @@ -3492,7 +3499,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst) int i; WindowPtr pWin = NULL; FocusClassPtr focus = IsPointerEvent((InternalEvent*)event) ? NULL : device->focus; - BOOL sendCore = (device->isMaster && device->coreEvents); + BOOL sendCore = (IsMaster(device) && device->coreEvents); if (event->type != ET_ButtonPress && event->type != ET_KeyPress) @@ -3548,7 +3555,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) { DeviceIntPtr ptr; WindowPtr focus = keybd->focus->win; - BOOL sendCore = (keybd->isMaster && keybd->coreEvents); + BOOL sendCore = (IsMaster(keybd) && keybd->coreEvents); xEvent core; xEvent *xE = NULL, *xi2 = NULL; int count, rc; @@ -3714,7 +3721,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, mask = grab->eventMask; - sendCore = (thisDev->isMaster && thisDev->coreEvents); + sendCore = (IsMaster(thisDev) && thisDev->coreEvents); /* try core event */ if (sendCore && grab->grabtype == GRABTYPE_CORE) { @@ -4201,7 +4208,7 @@ DeviceEnterLeaveEvent( if (BitIsOn(mouse->button->down, i)) SetBit(&event[1], i); - kbd = (mouse->isMaster || mouse->u.master) ? GetPairedDevice(mouse) : NULL; + kbd = (IsMaster(mouse) || mouse->u.master) ? GetPairedDevice(mouse) : NULL; if (kbd && kbd->key) { event->mods.base_mods = kbd->key->xkbInfo->state.base_mods; @@ -5583,7 +5590,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) Bool SetClientPointer(ClientPtr client, ClientPtr setter, DeviceIntPtr device) { - if (!device->isMaster) + if (!IsMaster(device)) { ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); return FALSE; @@ -5627,7 +5634,7 @@ PickPointer(ClientPtr client) DeviceIntPtr it = inputInfo.devices; while (it) { - if (it->isMaster && it->spriteInfo->spriteOwner) + if (IsMaster(it) && it->spriteInfo->spriteOwner) { client->clientPtr = it; break; diff --git a/dix/getevents.c b/dix/getevents.c index e40b3dbe9..5ff4f91b9 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -325,7 +325,7 @@ AllocateMotionHistory(DeviceIntPtr pDev) * potential valuators, plus the respective range of the valuators. * 3 * INT32 for (min_val, max_val, curr_val)) */ - if (pDev->isMaster) + if (IsMaster(pDev)) size = sizeof(INT32) * 3 * MAX_VALUATORS; else size = sizeof(INT32) * pDev->valuator->numAxes; @@ -369,7 +369,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, if (core && !pScreen) return 0; - if (pDev->isMaster) + if (IsMaster(pDev)) size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time); else size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time); @@ -421,7 +421,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, coord = rescaleValuatorAxis(coord, &from, to, pScreen->height); memcpy(corebuf, &coord, sizeof(INT16)); - } else if (pDev->isMaster) + } else if (IsMaster(pDev)) { memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */ @@ -497,7 +497,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, return; v = pDev->valuator; - if (pDev->isMaster) + if (IsMaster(pDev)) { buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) * v->last_motion; diff --git a/dix/inpututils.c b/dix/inpututils.c index 152214506..79b6ab7c7 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -268,9 +268,9 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap, do_modmap_change(client, dev, modmap); /* Change any attached masters/slaves. */ - if (dev->isMaster) { + if (IsMaster(dev)) { for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if (!tmp->isMaster && tmp->u.master == dev) + if (!IsMaster(tmp) && tmp->u.master == dev) if (check_modmap_change_slave(client, dev, tmp, modmap)) do_modmap_change(client, tmp, modmap); } 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; diff --git a/include/dix.h b/include/dix.h index 781198202..d4bec5f20 100644 --- a/include/dix.h +++ b/include/dix.h @@ -580,6 +580,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev); extern Bool IsPointerDevice( DeviceIntPtr dev); extern Bool IsKeyboardDevice(DeviceIntPtr dev); extern Bool IsPointerEvent(InternalEvent *event); +extern Bool IsMaster(DeviceIntPtr dev); /* * These are deprecated compatibility functions and will be removed soon! diff --git a/include/inputstr.h b/include/inputstr.h index 0fd348812..5c74ba391 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -458,6 +458,11 @@ typedef struct _SpriteInfoRec { pointer that owns the sprite. */ } SpriteInfoRec, *SpriteInfoPtr; +/* device types */ +#define MASTER_POINTER 1 +#define MASTER_KEYBOARD 2 +#define SLAVE 3 + typedef struct _DeviceIntRec { DeviceRec public; DeviceIntPtr next; @@ -470,7 +475,7 @@ typedef struct _DeviceIntRec { Bool enabled; /* TRUE if ON returns Success */ Bool coreEvents; /* TRUE if device also sends core */ GrabInfoRec deviceGrab; /* grab on the device */ - Bool isMaster; /* TRUE if device is master */ + int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */ Atom xinput_type; char *name; CARD8 id; @@ -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; @@ -521,7 +521,7 @@ ProcXkbBell(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixBellAccess); if (rc == Success) @@ -604,7 +604,7 @@ ProcXkbLatchLockState(ClientPtr client) status = Success; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { + if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) { if (!tmpd->key || !tmpd->key->xkbInfo) continue; @@ -746,7 +746,7 @@ ProcXkbSetControls(ClientPtr client) for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if (!tmpd->key || !tmpd->key->xkbInfo) continue; - if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { + if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) { xkbi = tmpd->key->xkbInfo; ctrl = xkbi->desc->ctrls; new = *ctrl; @@ -2556,7 +2556,7 @@ ProcXkbSetMap(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) @@ -2579,7 +2579,7 @@ ProcXkbSetMap(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) @@ -2886,7 +2886,7 @@ ProcXkbSetCompatMap(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) @@ -2909,7 +2909,7 @@ ProcXkbSetCompatMap(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) @@ -3164,7 +3164,7 @@ ProcXkbSetIndicatorMap(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess); if (rc == Success) @@ -3432,7 +3432,7 @@ ProcXkbSetNamedIndicator(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && !other->isMaster && (other->u.master == dev) && + if ((other != dev) && !IsMaster(other) && (other->u.master == dev) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { rc = _XkbCreateIndicatorMap(other, stuff->indicator, @@ -3455,7 +3455,7 @@ ProcXkbSetNamedIndicator(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && !other->isMaster && (other->u.master == dev) && + if ((other != dev) && !IsMaster(other) && (other->u.master == dev) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { _XkbSetNamedIndicator(client, other, stuff); @@ -4245,7 +4245,7 @@ ProcXkbSetNames(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); @@ -4270,7 +4270,7 @@ ProcXkbSetNames(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); @@ -5321,7 +5321,7 @@ ProcXkbSetGeometry(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev)) + if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); if (rc == Success) @@ -5835,7 +5835,7 @@ ProcXkbGetKbdByName(ClientPtr client) xkb->ctrls->num_groups= nTG; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { + if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) { if (tmpd != dev) XkbCopyDeviceKeymap(tmpd, dev); @@ -6499,7 +6499,7 @@ ProcXkbSetDeviceInfo(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if (((other != dev) && !other->isMaster && (other->u.master == dev)) && + if (((other != dev) && !IsMaster(other) && (other->u.master == dev)) && ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || (stuff->deviceSpec == XkbUseCorePtr && other->button))) { @@ -6524,7 +6524,7 @@ ProcXkbSetDeviceInfo(ClientPtr client) DeviceIntPtr other; for (other = inputInfo.devices; other; other = other->next) { - if (((other != dev) && !other->isMaster && (other->u.master == dev)) && + if (((other != dev) && !IsMaster(other) && (other->u.master == dev)) && ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || (stuff->deviceSpec == XkbUseCorePtr && other->button))) { |