dix: rename IsMaster to InputDevIsMaster()

Give it a better fitting name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-23 19:18:05 +02:00
parent 1b3de34f22
commit 4f2bd438cd
34 changed files with 142 additions and 141 deletions

View File

@ -650,7 +650,7 @@ AllocXTestDevice(ClientPtr client, const char *name,
BOOL BOOL
IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master) IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master)
{ {
if (IsMaster(dev)) if (InputDevIsMaster(dev))
return FALSE; return FALSE;
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest /* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest

View File

@ -771,7 +771,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
int rc; int rc;
/* For now, we don't have devices that change physically. */ /* For now, we don't have devices that change physically. */
if (!IsMaster(device)) if (!InputDevIsMaster(device))
return; return;
rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess); rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess);
@ -779,7 +779,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
if (rc != Success) if (rc != Success)
return; /* Device has disappeared */ return; /* Device has disappeared */
if (IsMaster(slave)) if (InputDevIsMaster(slave))
return; return;
if (IsFloating(slave)) if (IsFloating(slave))
@ -966,7 +966,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
if (!button_is_down(device, key, BUTTON_PROCESSED)) if (!button_is_down(device, key, BUTTON_PROCESSED))
return DONT_PROCESS; return DONT_PROCESS;
if (IsMaster(device)) { if (InputDevIsMaster(device)) {
DeviceIntPtr sd; DeviceIntPtr sd;
/* /*
@ -975,7 +975,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
* event being delivered through the slave first * event being delivered through the slave first
*/ */
for (sd = inputInfo.devices; sd; sd = sd->next) { for (sd = inputInfo.devices; sd; sd = sd->next) {
if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device) if (InputDevIsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device)
continue; continue;
if (!sd->button) if (!sd->button)
continue; continue;
@ -1676,7 +1676,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
(ev->any.type == ET_TouchEnd && ti->num_listeners > 0))) (ev->any.type == ET_TouchEnd && ti->num_listeners > 0)))
DeliverEmulatedMotionEvent(dev, ti, ev); DeliverEmulatedMotionEvent(dev, ti, ev);
if (emulate_pointer && IsMaster(dev)) if (emulate_pointer && InputDevIsMaster(dev))
CheckMotion(&ev->device_event, dev); CheckMotion(&ev->device_event, dev);
kbd = GetMaster(dev, KEYBOARD_OR_FLOAT); kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
@ -1716,7 +1716,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
int rc; int rc;
GrabPtr grab = dev->deviceGrab.grab; GrabPtr grab = dev->deviceGrab.grab;
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
return; return;
if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success) if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success)
@ -1777,7 +1777,7 @@ ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!dev->gesture) if (!dev->gesture)
return; return;
if (IsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev)) if (InputDevIsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
return; return;
if (IsGestureBeginEvent(ev)) if (IsGestureBeginEvent(ev))
@ -1852,7 +1852,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
b = device->button; b = device->button;
if (IsMaster(device) || IsFloating(device)) if (InputDevIsMaster(device) || IsFloating(device))
CheckMotion(event, device); CheckMotion(event, device);
switch (event->type) { switch (event->type) {
@ -1955,7 +1955,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
if (deactivateDeviceGrab == TRUE) { if (deactivateDeviceGrab == TRUE) {
(*device->deviceGrab.DeactivateGrab) (device); (*device->deviceGrab.DeactivateGrab) (device);
if (!IsMaster (device) && !IsFloating (device)) { if (!InputDevIsMaster (device) && !IsFloating (device)) {
int flags, num_events = 0; int flags, num_events = 0;
InternalEvent dce; InternalEvent dce;

View File

@ -157,9 +157,9 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, char **buf)
dev->id = d->id; dev->id = d->id;
dev->type = d->xinput_type; dev->type = d->xinput_type;
dev->num_classes = num_classes; dev->num_classes = num_classes;
if (IsMaster(d) && IsKeyboardDevice(d)) if (InputDevIsMaster(d) && IsKeyboardDevice(d))
dev->use = IsXKeyboard; dev->use = IsXKeyboard;
else if (IsMaster(d) && IsPointerDevice(d)) else if (InputDevIsMaster(d) && IsPointerDevice(d))
dev->use = IsXPointer; dev->use = IsXPointer;
else if (d->valuator && d->button) else if (d->valuator && d->button)
dev->use = IsXExtensionPointer; dev->use = IsXExtensionPointer;
@ -294,7 +294,7 @@ static Bool
ShouldSkipDevice(ClientPtr client, DeviceIntPtr d) ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
{ {
/* don't send master devices other than VCP/VCK */ /* don't send master devices other than VCP/VCK */
if (!IsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) { if (!InputDevIsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) {
int rc = XaceHookDeviceAccess(client, d, DixGetAttrAccess); int rc = XaceHookDeviceAccess(client, d, DixGetAttrAccess);
if (rc == Success) if (rc == Success)

View File

@ -97,7 +97,7 @@ ProcXOpenDevice(ClientPtr client)
else if (status != Success) else if (status != Success)
return status; return status;
if (IsMaster(dev)) if (InputDevIsMaster(dev))
return BadDevice; return BadDevice;
if (status != Success) if (status != Success)

View File

@ -104,15 +104,15 @@ ProcXIAllowEvents(ClientPtr client)
AllowSome(client, time, dev, GRAB_STATE_THAWED); AllowSome(client, time, dev, GRAB_STATE_THAWED);
break; break;
case XIAsyncPairedDevice: case XIAsyncPairedDevice:
if (IsMaster(dev)) if (InputDevIsMaster(dev))
AllowSome(client, time, dev, GRAB_STATE_THAW_OTHERS); AllowSome(client, time, dev, GRAB_STATE_THAW_OTHERS);
break; break;
case XISyncPair: case XISyncPair:
if (IsMaster(dev)) if (InputDevIsMaster(dev))
AllowSome(client, time, dev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT); AllowSome(client, time, dev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
break; break;
case XIAsyncPair: case XIAsyncPair:
if (IsMaster(dev)) if (InputDevIsMaster(dev))
AllowSome(client, time, dev, GRAB_STATE_THAWED_BOTH); AllowSome(client, time, dev, GRAB_STATE_THAWED_BOTH);
break; break;
case XIRejectTouch: case XIRejectTouch:

View File

@ -599,7 +599,7 @@ CreatePointerBarrierClient(ClientPtr client,
goto error; goto error;
} }
if (!IsMaster (device)) { if (!InputDevIsMaster (device)) {
client->errorValue = device_id; client->errorValue = device_id;
err = BadDevice; err = BadDevice;
goto error; goto error;

View File

@ -80,7 +80,7 @@ ProcXIChangeCursor(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
if (!IsMaster(pDev) || !IsPointerDevice(pDev)) if (!InputDevIsMaster(pDev) || !IsPointerDevice(pDev))
return BadDevice; return BadDevice;
if (stuff->win != None) { if (stuff->win != None) {

View File

@ -236,7 +236,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (!IsMaster(dev)) { if (!InputDevIsMaster(dev)) {
client->errorValue = r->deviceid; client->errorValue = r->deviceid;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;
@ -285,7 +285,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (!IsMaster(newptr) || !IsPointerDevice(newptr)) { if (!InputDevIsMaster(newptr) || !IsPointerDevice(newptr)) {
client->errorValue = r->return_pointer; client->errorValue = r->return_pointer;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;
@ -296,14 +296,14 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (!IsMaster(newkeybd) || !IsKeyboardDevice(newkeybd)) { if (!InputDevIsMaster(newkeybd) || !IsKeyboardDevice(newkeybd)) {
client->errorValue = r->return_keyboard; client->errorValue = r->return_keyboard;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;
} }
for (attached = inputInfo.devices; attached; attached = attached->next) { for (attached = inputInfo.devices; attached; attached = attached->next) {
if (!IsMaster(attached)) { if (!InputDevIsMaster(attached)) {
if (GetMaster(attached, MASTER_ATTACHED) == ptr) { if (GetMaster(attached, MASTER_ATTACHED) == ptr) {
AttachDevice(client, attached, newptr); AttachDevice(client, attached, newptr);
flags[attached->id] |= XISlaveAttached; flags[attached->id] |= XISlaveAttached;
@ -354,7 +354,7 @@ detach_slave(ClientPtr client, xXIDetachSlaveInfo * c, int flags[MAXDEVICES])
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
client->errorValue = c->deviceid; client->errorValue = c->deviceid;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;
@ -386,7 +386,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
client->errorValue = c->deviceid; client->errorValue = c->deviceid;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;
@ -402,7 +402,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess); rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess);
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
if (!IsMaster(newmaster)) { if (!InputDevIsMaster(newmaster)) {
client->errorValue = c->new_master; client->errorValue = c->new_master;
rc = BadDevice; rc = BadDevice;
goto unwind; goto unwind;

View File

@ -84,7 +84,7 @@ ProcXIGrabDevice(ClientPtr client)
if (!dev->enabled) if (!dev->enabled)
return AlreadyGrabbed; return AlreadyGrabbed;
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
stuff->paired_device_mode = GrabModeAsync; stuff->paired_device_mode = GrabModeAsync;
if (IsKeyboardDevice(dev)) { if (IsKeyboardDevice(dev)) {

View File

@ -176,7 +176,7 @@ static Bool
ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev) ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev)
{ {
/* if all devices are not being queried, only master devices are */ /* if all devices are not being queried, only master devices are */
if (deviceid == XIAllDevices || IsMaster(dev)) { if (deviceid == XIAllDevices || InputDevIsMaster(dev)) {
int rc = XaceHookDeviceAccess(client, dev, DixGetAttrAccess); int rc = XaceHookDeviceAccess(client, dev, DixGetAttrAccess);
if (rc == Success) if (rc == Success)
@ -515,7 +515,7 @@ GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment)
DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED); DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED);
int use; int use;
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
DeviceIntPtr paired = GetPairedDevice(dev); DeviceIntPtr paired = GetPairedDevice(dev);
use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard; use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard;

View File

@ -105,7 +105,7 @@ ProcXIQueryPointer(ClientPtr client)
return rc; return rc;
} }
if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || (!IsMaster(pDev) && !IsFloating(pDev))) { /* no attached devices */ if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || (!InputDevIsMaster(pDev) && !IsFloating(pDev))) { /* no attached devices */
client->errorValue = stuff->deviceid; client->errorValue = stuff->deviceid;
return BadDevice; return BadDevice;
} }
@ -119,7 +119,7 @@ ProcXIQueryPointer(ClientPtr client)
if (pDev->valuator->motionHintWindow) if (pDev->valuator->motionHintWindow)
MaybeStopHint(pDev, client); MaybeStopHint(pDev, client);
if (IsMaster(pDev)) if (InputDevIsMaster(pDev))
kbd = GetMaster(pDev, MASTER_KEYBOARD); kbd = GetMaster(pDev, MASTER_KEYBOARD);
else else
kbd = (pDev->key) ? pDev : NULL; kbd = (pDev->key) ? pDev : NULL;

View File

@ -74,7 +74,7 @@ ProcXISetClientPointer(ClientPtr client)
return rc; return rc;
} }
if (!IsMaster(pDev)) { if (!InputDevIsMaster(pDev)) {
client->errorValue = stuff->deviceid; client->errorValue = stuff->deviceid;
return BadDevice; return BadDevice;
} }

View File

@ -98,8 +98,8 @@ ProcXIWarpPointer(ClientPtr client)
return rc; return rc;
} }
if ((!IsMaster(pDev) && !IsFloating(pDev)) || if ((!InputDevIsMaster(pDev) && !IsFloating(pDev)) ||
(IsMaster(pDev) && !IsPointerDevice(pDev))) { (InputDevIsMaster(pDev) && !IsPointerDevice(pDev))) {
client->errorValue = stuff->deviceid; client->errorValue = stuff->deviceid;
return BadDevice; return BadDevice;
} }

View File

@ -198,7 +198,7 @@ PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd)
return BadDevice; return BadDevice;
/* Don't allow pairing for slave devices */ /* Don't allow pairing for slave devices */
if (!IsMaster(ptr) || !IsMaster(kbd)) if (!InputDevIsMaster(ptr) || !InputDevIsMaster(kbd))
return BadDevice; return BadDevice;
if (ptr->spriteInfo->paired) if (ptr->spriteInfo->paired)
@ -225,7 +225,7 @@ NextFreePointerDevice(void)
DeviceIntPtr dev; DeviceIntPtr dev;
for (dev = inputInfo.devices; dev; dev = dev->next) for (dev = inputInfo.devices; dev; dev = dev->next)
if (IsMaster(dev) && if (InputDevIsMaster(dev) &&
dev->spriteInfo->spriteOwner && !dev->spriteInfo->paired) dev->spriteInfo->spriteOwner && !dev->spriteInfo->paired)
return dev; return dev;
return NULL; return NULL;
@ -375,7 +375,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
*prev && (*prev != dev); prev = &(*prev)->next); *prev && (*prev != dev); prev = &(*prev)->next);
if (!dev->spriteInfo->sprite) { if (!dev->spriteInfo->sprite) {
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
/* Sprites appear on first root window, so we can hardcode it */ /* Sprites appear on first root window, so we can hardcode it */
if (dev->spriteInfo->spriteOwner) { if (dev->spriteInfo->spriteOwner) {
InitializeSprite(dev, screenInfo.screens[0]->root); InitializeSprite(dev, screenInfo.screens[0]->root);
@ -424,7 +424,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
XISendDeviceHierarchyEvent(flags); XISendDeviceHierarchyEvent(flags);
} }
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0); XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
/* Now make sure our LEDs are in sync with the locked state */ /* Now make sure our LEDs are in sync with the locked state */
@ -478,16 +478,16 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
dev->idle_counter = NULL; dev->idle_counter = NULL;
/* float attached devices */ /* float attached devices */
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { if (!InputDevIsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) {
AttachDevice(NULL, other, NULL); AttachDevice(NULL, other, NULL);
flags[other->id] |= XISlaveDetached; flags[other->id] |= XISlaveDetached;
} }
} }
for (other = inputInfo.off_devices; other; other = other->next) { for (other = inputInfo.off_devices; other; other = other->next) {
if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { if (!InputDevIsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) {
AttachDevice(NULL, other, NULL); AttachDevice(NULL, other, NULL);
flags[other->id] |= XISlaveDetached; flags[other->id] |= XISlaveDetached;
} }
@ -495,12 +495,12 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
} }
else { else {
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if (IsMaster(other) && other->lastSlave == dev) if (InputDevIsMaster(other) && other->lastSlave == dev)
other->lastSlave = NULL; other->lastSlave = NULL;
} }
} }
if (IsMaster(dev) && dev->spriteInfo->sprite) { if (InputDevIsMaster(dev) && dev->spriteInfo->sprite) {
for (other = inputInfo.devices; other; other = other->next) for (other = inputInfo.devices; other; other = other->next)
if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner) if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
DisableDevice(other, sendevent); DisableDevice(other, sendevent);
@ -556,17 +556,17 @@ DisableAllDevices(void)
/* Disable slave devices first, excluding XTest devices */ /* Disable slave devices first, excluding XTest devices */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (!IsXTestDevice(dev, NULL) && !IsMaster(dev)) if (!IsXTestDevice(dev, NULL) && !InputDevIsMaster(dev))
DisableDevice(dev, FALSE); DisableDevice(dev, FALSE);
} }
/* Disable XTest devices */ /* Disable XTest devices */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
DisableDevice(dev, FALSE); DisableDevice(dev, FALSE);
} }
/* master keyboards need to be disabled first */ /* master keyboards need to be disabled first */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (dev->enabled && IsMaster(dev) && IsKeyboardDevice(dev)) if (dev->enabled && InputDevIsMaster(dev) && IsKeyboardDevice(dev))
DisableDevice(dev, FALSE); DisableDevice(dev, FALSE);
} }
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
@ -602,7 +602,7 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent)
return ret; return ret;
/* Initialize memory for sprites. */ /* Initialize memory for sprites. */
if (IsMaster(dev) && dev->spriteInfo->spriteOwner) if (InputDevIsMaster(dev) && dev->spriteInfo->spriteOwner)
if (!pScreen->DeviceCursorInitialize(dev, pScreen)) if (!pScreen->DeviceCursorInitialize(dev, pScreen))
ret = BadAlloc; ret = BadAlloc;
@ -1023,7 +1023,7 @@ CloseDevice(DeviceIntPtr dev)
FreeSprite(dev); FreeSprite(dev);
if (IsMaster(dev)) if (InputDevIsMaster(dev))
screen->DeviceCursorCleanup(dev, screen); screen->DeviceCursorCleanup(dev, screen);
/* free acceleration info */ /* free acceleration info */
@ -1038,7 +1038,7 @@ CloseDevice(DeviceIntPtr dev)
classes = (ClassesPtr) &dev->key; classes = (ClassesPtr) &dev->key;
FreeAllDeviceClasses(classes); FreeAllDeviceClasses(classes);
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
classes = dev->unused_classes; classes = dev->unused_classes;
FreeAllDeviceClasses(classes); FreeAllDeviceClasses(classes);
free(classes); free(classes);
@ -1110,12 +1110,12 @@ CloseDownDevices(void)
* to NULL and pretend nothing happened. * to NULL and pretend nothing happened.
*/ */
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
dev->master = NULL; dev->master = NULL;
} }
for (dev = inputInfo.off_devices; dev; dev = dev->next) { for (dev = inputInfo.off_devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
dev->master = NULL; dev->master = NULL;
} }
@ -1151,12 +1151,12 @@ AbortDevices(void)
* cause a dead-lock. * cause a dead-lock.
*/ */
nt_list_for_each_entry(dev, inputInfo.devices, next) { nt_list_for_each_entry(dev, inputInfo.devices, next) {
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
(*dev->deviceProc) (dev, DEVICE_ABORT); (*dev->deviceProc) (dev, DEVICE_ABORT);
} }
nt_list_for_each_entry(dev, inputInfo.off_devices, next) { nt_list_for_each_entry(dev, inputInfo.off_devices, next) {
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
(*dev->deviceProc) (dev, DEVICE_ABORT); (*dev->deviceProc) (dev, DEVICE_ABORT);
} }
} }
@ -1234,7 +1234,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent)
flags[dev->id] = XIDeviceDisabled; flags[dev->id] = XIDeviceDisabled;
} }
flag = IsMaster(dev) ? XIMasterRemoved : XISlaveRemoved; flag = InputDevIsMaster(dev) ? XIMasterRemoved : XISlaveRemoved;
input_lock(); input_lock();
@ -1412,7 +1412,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
dev->last.numValuators = numAxes; dev->last.numValuators = numAxes;
if (IsMaster(dev) || /* do not accelerate master or xtest devices */ if (InputDevIsMaster(dev) || /* do not accelerate master or xtest devices */
IsXTestDevice(dev, NULL)) IsXTestDevice(dev, NULL))
InitPointerAccelerationScheme(dev, PtrAccelNoOp); InitPointerAccelerationScheme(dev, PtrAccelNoOp);
else else
@ -1444,7 +1444,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme)
if (!val) if (!val)
return FALSE; return FALSE;
if (IsMaster(dev) && scheme != PtrAccelNoOp) if (InputDevIsMaster(dev) && scheme != PtrAccelNoOp)
return FALSE; return FALSE;
for (x = 0; pointerAccelerationScheme[x].number >= 0; x++) { for (x = 0; pointerAccelerationScheme[x].number >= 0; x++) {
@ -1869,7 +1869,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
stuff->keyCodes, NULL, client); stuff->keyCodes, NULL, client);
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
if (IsMaster(tmp) || GetMaster(tmp, MASTER_KEYBOARD) != pDev) if (InputDevIsMaster(tmp) || GetMaster(tmp, MASTER_KEYBOARD) != pDev)
continue; continue;
if (!tmp->key) if (!tmp->key)
continue; continue;
@ -2222,7 +2222,7 @@ ProcChangeKeyboardControl(ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev == keyboard || if ((pDev == keyboard ||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard)) (!InputDevIsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = XaceHookDeviceAccess(client, pDev, DixManageAccess); ret = XaceHookDeviceAccess(client, pDev, DixManageAccess);
if (ret != Success) if (ret != Success)
@ -2232,7 +2232,7 @@ ProcChangeKeyboardControl(ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev == keyboard || if ((pDev == keyboard ||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard)) (!InputDevIsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask); ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
if (ret != Success) if (ret != Success)
@ -2298,7 +2298,7 @@ ProcBell(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if ((dev == keybd || if ((dev == keybd ||
(!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) && (!InputDevIsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) &&
((dev->kbdfeed && dev->kbdfeed->BellProc) || dev->xkb_interest)) { ((dev->kbdfeed && dev->kbdfeed->BellProc) || dev->xkb_interest)) {
rc = XaceHookDeviceAccess(client, dev, DixBellAccess); rc = XaceHookDeviceAccess(client, dev, DixBellAccess);
@ -2372,7 +2372,7 @@ ProcChangePointerControl(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if ((dev == mouse || if ((dev == mouse ||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) && (!InputDevIsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) { dev->ptrfeed) {
rc = XaceHookDeviceAccess(client, dev, DixManageAccess); rc = XaceHookDeviceAccess(client, dev, DixManageAccess);
if (rc != Success) if (rc != Success)
@ -2382,7 +2382,7 @@ ProcChangePointerControl(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if ((dev == mouse || if ((dev == mouse ||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) && (!InputDevIsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) { dev->ptrfeed) {
dev->ptrfeed->ctrl = ctrl; dev->ptrfeed->ctrl = ctrl;
} }
@ -2546,7 +2546,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
DeviceIntPtr dev, master; DeviceIntPtr dev, master;
int maxbuttons = 0; int maxbuttons = 0;
if (!slave->button || IsMaster(slave)) if (!slave->button || InputDevIsMaster(slave))
return; return;
master = GetMaster(slave, MASTER_POINTER); master = GetMaster(slave, MASTER_POINTER);
@ -2554,7 +2554,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
return; return;
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) || if (InputDevIsMaster(dev) ||
GetMaster(dev, MASTER_ATTACHED) != master || !dev->button) GetMaster(dev, MASTER_ATTACHED) != master || !dev->button)
continue; continue;
@ -2660,10 +2660,10 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
{ {
ScreenPtr screen; ScreenPtr screen;
if (!dev || IsMaster(dev)) if (!dev || InputDevIsMaster(dev))
return BadDevice; return BadDevice;
if (master && !IsMaster(master)) /* can't attach to slaves */ if (master && !InputDevIsMaster(master)) /* can't attach to slaves */
return BadDevice; return BadDevice;
/* set from floating to floating? */ /* set from floating to floating? */
@ -2734,7 +2734,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
DeviceIntPtr DeviceIntPtr
GetPairedDevice(DeviceIntPtr dev) GetPairedDevice(DeviceIntPtr dev)
{ {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
dev = GetMaster(dev, MASTER_ATTACHED); dev = GetMaster(dev, MASTER_ATTACHED);
return (dev && dev->spriteInfo) ? dev->spriteInfo->paired: NULL; return (dev && dev->spriteInfo) ? dev->spriteInfo->paired: NULL;
@ -2763,7 +2763,7 @@ GetMaster(DeviceIntPtr dev, int which)
{ {
DeviceIntPtr master; DeviceIntPtr master;
if (IsMaster(dev)) if (InputDevIsMaster(dev))
master = dev; master = dev;
else { else {
master = dev->master; master = dev->master;
@ -2859,7 +2859,7 @@ AllocDevicePair(ClientPtr client, const char *name,
keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE; keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE;
/* The ClassesRec stores the device classes currently not used. */ /* The ClassesRec stores the device classes currently not used. */
if (IsMaster(pointer)) { if (InputDevIsMaster(pointer)) {
pointer->unused_classes = calloc(1, sizeof(ClassesRec)); pointer->unused_classes = calloc(1, sizeof(ClassesRec));
keyboard->unused_classes = calloc(1, sizeof(ClassesRec)); keyboard->unused_classes = calloc(1, sizeof(ClassesRec));
} }

View File

@ -540,7 +540,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode)
static void static void
CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode) CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
{ {
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
return; return;
LeaveWindow(dev); LeaveWindow(dev);
@ -1396,7 +1396,7 @@ CoreFocusFromPointerRootOrNone(DeviceIntPtr dev,
static void static void
CoreFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode) CoreFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
{ {
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
return; return;
SetFocusOut(dev); SetFocusOut(dev);

View File

@ -343,7 +343,7 @@ IsKeyboardDevice(DeviceIntPtr dev)
} }
Bool Bool
IsMaster(DeviceIntPtr dev) InputDevIsMaster(DeviceIntPtr dev)
{ {
return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD; return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
} }
@ -351,7 +351,7 @@ IsMaster(DeviceIntPtr dev)
Bool Bool
IsFloating(DeviceIntPtr dev) IsFloating(DeviceIntPtr dev)
{ {
return !IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == NULL; return !InputDevIsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == NULL;
} }
/** /**
@ -1429,7 +1429,7 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
thisDev->deviceGrab.sync.other = NullGrab; thisDev->deviceGrab.sync.other = NullGrab;
} }
if (IsMaster(thisDev)) { if (InputDevIsMaster(thisDev)) {
dev = GetPairedDevice(thisDev); dev = GetPairedDevice(thisDev);
if (otherMode == GrabModeSync) if (otherMode == GrabModeSync)
dev->deviceGrab.sync.other = grab; dev->deviceGrab.sync.other = grab;
@ -1468,7 +1468,7 @@ ReattachToOldMaster(DeviceIntPtr dev)
{ {
DeviceIntPtr master = NULL; DeviceIntPtr master = NULL;
if (IsMaster(dev)) if (InputDevIsMaster(dev))
return; return;
dixLookupDevice(&master, dev->saved_master_id, serverClient, DixUseAccess); dixLookupDevice(&master, dev->saved_master_id, serverClient, DixUseAccess);
@ -1613,7 +1613,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
/* slave devices need to float for the duration of the grab. */ /* slave devices need to float for the duration of the grab. */
if (grab->grabtype == XI2 && if (grab->grabtype == XI2 &&
!(autoGrab & ImplicitGrabMask) && !IsMaster(mouse)) !(autoGrab & ImplicitGrabMask) && !InputDevIsMaster(mouse))
DetachFromMaster(mouse); DetachFromMaster(mouse);
if (grab->confineTo) { if (grab->confineTo) {
@ -1734,7 +1734,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
/* slave devices need to float for the duration of the grab. */ /* slave devices need to float for the duration of the grab. */
if (grab->grabtype == XI2 && keybd->enabled && if (grab->grabtype == XI2 && keybd->enabled &&
!(passive & ImplicitGrabMask) && !IsMaster(keybd)) !(passive & ImplicitGrabMask) && !InputDevIsMaster(keybd))
DetachFromMaster(keybd); DetachFromMaster(keybd);
if (!keybd->enabled) if (!keybd->enabled)
@ -2901,7 +2901,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
} }
/* Core event */ /* Core event */
if ((mask & EVENT_CORE_MASK) && IsMaster(dev) && dev->coreEvents) { if ((mask & EVENT_CORE_MASK) && InputDevIsMaster(dev) && dev->coreEvents) {
deliveries = deliveries =
DeliverOneEvent(event, dev, CORE, pWin, child, grab); DeliverOneEvent(event, dev, CORE, pWin, child, grab);
if (deliveries > 0) if (deliveries > 0)
@ -3261,7 +3261,7 @@ WindowsRestructured(void)
DeviceIntPtr pDev = inputInfo.devices; DeviceIntPtr pDev = inputInfo.devices;
while (pDev) { while (pDev) {
if (IsMaster(pDev) || IsFloating(pDev)) if (InputDevIsMaster(pDev) || IsFloating(pDev))
CheckMotion(NULL, pDev); CheckMotion(NULL, pDev);
pDev = pDev->next; pDev = pDev->next;
} }
@ -3967,7 +3967,7 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
* attached master keyboard. Since the slave may have been * attached master keyboard. Since the slave may have been
* reattached after the grab, the modifier device may not be the * reattached after the grab, the modifier device may not be the
* same. */ * same. */
if (!IsMaster(grab->device) && !IsFloating(device)) if (!InputDevIsMaster(grab->device) && !IsFloating(device))
gdev = GetMaster(device, MASTER_KEYBOARD); gdev = GetMaster(device, MASTER_KEYBOARD);
} }
@ -4126,7 +4126,7 @@ CheckDeviceGrabs(DeviceIntPtr device, InternalEvent *ievent, WindowPtr ancestor)
WindowPtr pWin = NULL; WindowPtr pWin = NULL;
FocusClassPtr focus = FocusClassPtr focus =
IsPointerEvent(ievent) ? NULL : device->focus; IsPointerEvent(ievent) ? NULL : device->focus;
BOOL sendCore = (IsMaster(device) && device->coreEvents); BOOL sendCore = (InputDevIsMaster(device) && device->coreEvents);
Bool ret = FALSE; Bool ret = FALSE;
DeviceEvent *event = &ievent->device_event; DeviceEvent *event = &ievent->device_event;
@ -4195,7 +4195,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
{ {
DeviceIntPtr ptr; DeviceIntPtr ptr;
WindowPtr focus = keybd->focus->win; WindowPtr focus = keybd->focus->win;
BOOL sendCore = (IsMaster(keybd) && keybd->coreEvents); BOOL sendCore = (InputDevIsMaster(keybd) && keybd->coreEvents);
xEvent *core = NULL, *xE = NULL, *xi2 = NULL; xEvent *core = NULL, *xE = NULL, *xi2 = NULL;
int count, rc; int count, rc;
int deliveries = 0; int deliveries = 0;
@ -4390,7 +4390,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
thisDev); thisDev);
} }
if (!deliveries) { if (!deliveries) {
sendCore = (IsMaster(thisDev) && thisDev->coreEvents); sendCore = (InputDevIsMaster(thisDev) && thisDev->coreEvents);
/* try core event */ /* try core event */
if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE) if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE)
deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype); deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype);
@ -6158,7 +6158,7 @@ SetClientPointer(ClientPtr client, DeviceIntPtr device)
if (rc != Success) if (rc != Success)
return rc; return rc;
if (!IsMaster(device)) { if (!InputDevIsMaster(device)) {
ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n");
return BadDevice; return BadDevice;
} }
@ -6197,7 +6197,7 @@ PickPointer(ClientPtr client)
if (!client->clientPtr) { if (!client->clientPtr) {
it = inputInfo.devices; it = inputInfo.devices;
while (it) { while (it) {
if (IsMaster(it) && it->spriteInfo->spriteOwner) { if (InputDevIsMaster(it) && it->spriteInfo->spriteOwner) {
client->clientPtr = it; client->clientPtr = it;
break; break;
} }

View File

@ -375,7 +375,7 @@ AllocateMotionHistory(DeviceIntPtr pDev)
* potential valuators, plus the respective range of the valuators. * potential valuators, plus the respective range of the valuators.
* 3 * INT32 for (min_val, max_val, curr_val)) * 3 * INT32 for (min_val, max_val, curr_val))
*/ */
if (IsMaster(pDev)) if (InputDevIsMaster(pDev))
size = sizeof(INT32) * 3 * MAX_VALUATORS; size = sizeof(INT32) * 3 * MAX_VALUATORS;
else { else {
ValuatorClassPtr v = pDev->valuator; ValuatorClassPtr v = pDev->valuator;
@ -427,7 +427,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start,
if (core && !pScreen) if (core && !pScreen)
return 0; return 0;
if (IsMaster(pDev)) if (InputDevIsMaster(pDev))
size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time); size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time);
else else
size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time); size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time);
@ -481,7 +481,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start,
memcpy(corebuf, &coord, sizeof(INT16)); memcpy(corebuf, &coord, sizeof(INT16));
} }
else if (IsMaster(pDev)) { else if (InputDevIsMaster(pDev)) {
memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */ memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */
ocbuf = (INT32 *) (obuff + sizeof(Time)); ocbuf = (INT32 *) (obuff + sizeof(Time));
@ -551,7 +551,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
return; return;
v = pDev->valuator; v = pDev->valuator;
if (IsMaster(pDev)) { if (InputDevIsMaster(pDev)) {
buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) * buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) *
v->last_motion; v->last_motion;
@ -786,7 +786,7 @@ static void
moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask) moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
{ {
int i; int i;
Bool clip_xy = IsMaster(dev) || !IsFloating(dev); Bool clip_xy = InputDevIsMaster(dev) || !IsFloating(dev);
ValuatorClassPtr v = dev->valuator; ValuatorClassPtr v = dev->valuator;
/* for abs devices in relative mode, we've just scaled wrong, since we /* for abs devices in relative mode, we've just scaled wrong, since we
@ -1006,7 +1006,7 @@ updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms)
return; return;
updateMotionHistory(dev, ms, mask, dev->last.valuators); updateMotionHistory(dev, ms, mask, dev->last.valuators);
if (!IsMaster(dev) && !IsFloating(dev)) { if (!InputDevIsMaster(dev) && !IsFloating(dev)) {
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
updateMotionHistory(master, ms, mask, dev->last.valuators); updateMotionHistory(master, ms, mask, dev->last.valuators);
@ -1450,7 +1450,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
storeLastValuators(pDev, &mask, devx, devy); storeLastValuators(pDev, &mask, devx, devy);
/* Update the MD's coordinates, which are always in desktop space. */ /* Update the MD's coordinates, which are always in desktop space. */
if (!IsMaster(pDev) && !IsFloating(pDev)) { if (!InputDevIsMaster(pDev) && !IsFloating(pDev)) {
DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER); DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
master->last.valuators[0] = screenx; master->last.valuators[0] = screenx;
@ -1972,7 +1972,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
emulate_pointer = ti->emulate_pointer; emulate_pointer = ti->emulate_pointer;
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
events = events =
UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT, &num_events); UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT, &num_events);
@ -2067,7 +2067,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
storeLastValuators(dev, &mask, devx, devy); storeLastValuators(dev, &mask, devx, devy);
/* Update the MD's coordinates, which are always in desktop space. */ /* Update the MD's coordinates, which are always in desktop space. */
if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) { if (emulate_pointer && !InputDevIsMaster(dev) && !IsFloating(dev)) {
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
master->last.valuators[0] = screenx; master->last.valuators[0] = screenx;
@ -2224,7 +2224,7 @@ GetGestureEvents(InternalEvent *events, DeviceIntPtr dev,
if (!dev->enabled || !g) if (!dev->enabled || !g)
return 0; return 0;
if (!IsMaster(dev)) if (!InputDevIsMaster(dev))
events = UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT, events = UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT,
&num_events); &num_events);

View File

@ -451,12 +451,12 @@ GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice)
} }
else if (pFirstGrab->device == inputInfo.all_master_devices) { else if (pFirstGrab->device == inputInfo.all_master_devices) {
if (pSecondGrab->device != inputInfo.all_master_devices && if (pSecondGrab->device != inputInfo.all_master_devices &&
!IsMaster(pSecondGrab->device)) !InputDevIsMaster(pSecondGrab->device))
return FALSE; return FALSE;
} }
else if (pSecondGrab->device == inputInfo.all_master_devices) { else if (pSecondGrab->device == inputInfo.all_master_devices) {
if (pFirstGrab->device != inputInfo.all_master_devices && if (pFirstGrab->device != inputInfo.all_master_devices &&
!IsMaster(pFirstGrab->device)) !InputDevIsMaster(pFirstGrab->device))
return FALSE; return FALSE;
} }
else if (pSecondGrab->device != pFirstGrab->device) else if (pSecondGrab->device != pFirstGrab->device)

View File

@ -461,7 +461,7 @@ Bool IsKeyboardDevice(DeviceIntPtr dev)
* @param dev device to be checked * @param dev device to be checked
* @return TRUE if the device is a master * @return TRUE if the device is a master
*/ */
Bool IsMaster(DeviceIntPtr dev) Bool InputDevIsMaster(DeviceIntPtr dev)
_X_ATTRIBUTE_NONNULL_ARG(1); _X_ATTRIBUTE_NONNULL_ARG(1);
#endif /* _XSERVER_INPUT_PRIV_H */ #endif /* _XSERVER_INPUT_PRIV_H */

View File

@ -266,9 +266,9 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
do_modmap_change(client, dev, modmap); do_modmap_change(client, dev, modmap);
/* Change any attached masters/slaves. */ /* Change any attached masters/slaves. */
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
if (!IsMaster(tmp) && GetMaster(tmp, MASTER_KEYBOARD) == dev) if (!InputDevIsMaster(tmp) && GetMaster(tmp, MASTER_KEYBOARD) == dev)
if (check_modmap_change_slave(client, dev, tmp, modmap)) if (check_modmap_change_slave(client, dev, tmp, modmap))
do_modmap_change(client, tmp, modmap); do_modmap_change(client, tmp, modmap);
} }
@ -1158,7 +1158,7 @@ xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type)
set = 1; set = 1;
else if (xi2mask_isset_for_device(mask, dev, event_type)) else if (xi2mask_isset_for_device(mask, dev, event_type))
set = 1; set = 1;
else if (IsMaster(dev) && xi2mask_isset_for_device(mask, inputInfo.all_master_devices, event_type)) else if (InputDevIsMaster(dev) && xi2mask_isset_for_device(mask, inputInfo.all_master_devices, event_type))
set = 1; set = 1;
return set; return set;

View File

@ -724,7 +724,7 @@ TouchAddPassiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
WindowPtr win, InternalEvent *ev) WindowPtr win, InternalEvent *ev)
{ {
GrabPtr grab; GrabPtr grab;
Bool check_core = IsMaster(dev) && ti->emulate_pointer; Bool check_core = InputDevIsMaster(dev) && ti->emulate_pointer;
/* FIXME: make CheckPassiveGrabsOnWindow only trigger on TouchBegin */ /* FIXME: make CheckPassiveGrabsOnWindow only trigger on TouchBegin */
grab = CheckPassiveGrabsOnWindow(win, dev, ev, check_core, FALSE); grab = CheckPassiveGrabsOnWindow(win, dev, ev, check_core, FALSE);
@ -797,7 +797,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
OtherClients *oclients; OtherClients *oclients;
/* window owner */ /* window owner */
if (IsMaster(dev) && (win->eventMask & core_filter)) { if (InputDevIsMaster(dev) && (win->eventMask & core_filter)) {
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, win->drawable.id, X11_RESTYPE_WINDOW, CORE, TouchAddListener(ti, win->drawable.id, X11_RESTYPE_WINDOW, CORE,
TOUCH_LISTENER_POINTER_REGULAR, TOUCH_LISTENER_POINTER_REGULAR,

View File

@ -1003,7 +1003,7 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
UpdateDeviceState(keybd, &ev); UpdateDeviceState(keybd, &ev);
if (!IsMaster(keybd)) if (!InputDevIsMaster(keybd))
return; return;
/* /*
@ -1057,7 +1057,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
UpdateDeviceState(mouse, &ev); UpdateDeviceState(mouse, &ev);
if (!IsMaster(mouse)) if (!InputDevIsMaster(mouse))
return; return;
/* /*

View File

@ -242,7 +242,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
Bool view_adjusted = FALSE; Bool view_adjusted = FALSE;
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
continue; continue;
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
@ -314,7 +314,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
* FIXME: duplicated code, see modes/xf86RandR12.c * FIXME: duplicated code, see modes/xf86RandR12.c
*/ */
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
continue; continue;
if (pScreen == miPointerGetScreen(dev)) { if (pScreen == miPointerGetScreen(dev)) {
@ -325,7 +325,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
py = (py >= pScreen->height ? (pScreen->height - 1) : py); py = (py >= pScreen->height ? (pScreen->height - 1) : py);
/* Setting the viewpoint makes only sense on one device */ /* Setting the viewpoint makes only sense on one device */
if (!view_adjusted && IsMaster(dev)) { if (!view_adjusted && InputDevIsMaster(dev)) {
xf86SetViewport(pScreen, px, py); xf86SetViewport(pScreen, px, py);
view_adjusted = TRUE; view_adjusted = TRUE;
} }

View File

@ -1138,7 +1138,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
{ {
InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate; InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate;
InputDriverPtr drv = NULL; InputDriverPtr drv = NULL;
Bool isMaster = IsMaster(pDev); Bool isMaster = InputDevIsMaster(pDev);
if (pInfo) /* need to get these before RemoveDevice */ if (pInfo) /* need to get these before RemoveDevice */
drv = pInfo->drv; drv = pInfo->drv;

View File

@ -602,7 +602,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
} }
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
continue; continue;
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
@ -650,7 +650,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
* FIXME: duplicated code, see modes/xf86RandR12.c * FIXME: duplicated code, see modes/xf86RandR12.c
*/ */
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
continue; continue;
if (pScreen == miPointerGetScreen(dev)) { if (pScreen == miPointerGetScreen(dev)) {
@ -661,7 +661,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
py = (py >= pScreen->height ? (pScreen->height - 1) : py); py = (py >= pScreen->height ? (pScreen->height - 1) : py);
/* Setting the viewpoint makes only sense on one device */ /* Setting the viewpoint makes only sense on one device */
if (!view_adjusted && IsMaster(dev)) { if (!view_adjusted && InputDevIsMaster(dev)) {
xf86SetViewport(pScreen, px, py); xf86SetViewport(pScreen, px, py);
view_adjusted = TRUE; view_adjusted = TRUE;
} }

View File

@ -42,6 +42,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/extensions/geproto.h> #include <X11/extensions/geproto.h>
#include "dix/cursor_priv.h" #include "dix/cursor_priv.h"
#include "dix/input_priv.h"
#include "mi/mi_priv.h" #include "mi/mi_priv.h"
#include "mi/mipointer_priv.h" #include "mi/mipointer_priv.h"
#include "os/bug_priv.h" #include "os/bug_priv.h"
@ -398,7 +399,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
verify_internal_event(original); verify_internal_event(original);
/* ET_XQuartz has sdev == NULL */ /* ET_XQuartz has sdev == NULL */
if (!sdev || IsMaster(sdev) || IsFloating(sdev)) if (!sdev || InputDevIsMaster(sdev) || IsFloating(sdev))
return NULL; return NULL;
#ifdef XFreeXDGA #ifdef XFreeXDGA

View File

@ -367,7 +367,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
SetupScreen(pScreen); SetupScreen(pScreen);
if (!IsMaster(pDev) && !IsFloating(pDev)) if (!InputDevIsMaster(pDev) && !IsFloating(pDev))
return; return;
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen); (*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen);

View File

@ -782,7 +782,7 @@ RecordADeviceEvent(CallbackListPtr *pcbl, void *nulldata, void *calldata)
xEvent *xi_events = NULL; xEvent *xi_events = NULL;
/* TODO check return values */ /* TODO check return values */
if (IsMaster(pei->device)) { if (InputDevIsMaster(pei->device)) {
xEvent *core_events; xEvent *core_events;
EventToCore(pei->event, &core_events, &count); EventToCore(pei->event, &core_events, &count);

View File

@ -877,7 +877,7 @@ ProcXFixesHideCursor(ClientPtr client)
DeviceIntPtr dev; DeviceIntPtr dev;
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev)) if (InputDevIsMaster(dev) && IsPointerDevice(dev))
CursorDisplayCursor(dev, pWin->drawable.pScreen, CursorDisplayCursor(dev, pWin->drawable.pScreen,
CursorForDevice(dev)); CursorForDevice(dev));
} }
@ -968,7 +968,7 @@ CursorFreeHideCount(void *data, XID id)
deleteCursorHideCount(pChc, pChc->pScreen); deleteCursorHideCount(pChc, pChc->pScreen);
for (dev = inputInfo.devices; dev; dev = dev->next) { for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev)) if (InputDevIsMaster(dev) && IsPointerDevice(dev))
CursorDisplayCursor(dev, pScreen, CursorForDevice(dev)); CursorDisplayCursor(dev, pScreen, CursorForDevice(dev));
} }

View File

@ -560,7 +560,7 @@ ProcXkbBell(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixBellAccess); rc = XaceHookDeviceAccess(client, other, DixBellAccess);
if (rc == Success) if (rc == Success)
@ -644,7 +644,7 @@ ProcXkbLatchLockState(ClientPtr client)
for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
if ((tmpd == dev) || if ((tmpd == dev) ||
(!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { (!InputDevIsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
if (!tmpd->key || !tmpd->key->xkbInfo) if (!tmpd->key || !tmpd->key->xkbInfo)
continue; continue;
@ -789,7 +789,7 @@ ProcXkbSetControls(ClientPtr client)
if (!tmpd->key || !tmpd->key->xkbInfo) if (!tmpd->key || !tmpd->key->xkbInfo)
continue; continue;
if ((tmpd == dev) || if ((tmpd == dev) ||
(!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { (!InputDevIsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
xkbi = tmpd->key->xkbInfo; xkbi = tmpd->key->xkbInfo;
ctrl = xkbi->desc->ctrls; ctrl = xkbi->desc->ctrls;
new = *ctrl; new = *ctrl;
@ -2747,7 +2747,7 @@ ProcXkbSetMap(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
if (rc == Success) { if (rc == Success) {
@ -2780,7 +2780,7 @@ ProcXkbSetMap(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
if (rc == Success) if (rc == Success)
@ -3119,7 +3119,7 @@ ProcXkbSetCompatMap(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
if (rc == Success) { if (rc == Success) {
@ -3140,7 +3140,7 @@ ProcXkbSetCompatMap(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
if (rc == Success) { if (rc == Success) {
@ -3401,7 +3401,7 @@ ProcXkbSetIndicatorMap(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixSetAttrAccess); rc = XaceHookDeviceAccess(client, other, DixSetAttrAccess);
if (rc == Success) if (rc == Success)
@ -3665,7 +3665,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && !IsMaster(other) && if ((other != dev) && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed || GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed ||
other->leds) && other->leds) &&
(XaceHookDeviceAccess(client, other, DixSetAttrAccess) (XaceHookDeviceAccess(client, other, DixSetAttrAccess)
@ -3689,7 +3689,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && !IsMaster(other) && if ((other != dev) && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed || GetMaster(other, MASTER_KEYBOARD) == dev && (other->kbdfeed ||
other->leds) && other->leds) &&
(XaceHookDeviceAccess(client, other, DixSetAttrAccess) (XaceHookDeviceAccess(client, other, DixSetAttrAccess)
@ -4528,7 +4528,7 @@ ProcXkbSetNames(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
@ -4551,7 +4551,7 @@ ProcXkbSetNames(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
@ -5684,7 +5684,7 @@ ProcXkbSetGeometry(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if ((other != dev) && other->key && !IsMaster(other) && if ((other != dev) && other->key && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) { GetMaster(other, MASTER_KEYBOARD) == dev) {
rc = XaceHookDeviceAccess(client, other, DixManageAccess); rc = XaceHookDeviceAccess(client, other, DixManageAccess);
if (rc == Success) if (rc == Success)
@ -6946,7 +6946,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if (((other != dev) && !IsMaster(other) && if (((other != dev) && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) && GetMaster(other, MASTER_KEYBOARD) == dev) &&
((stuff->deviceSpec == XkbUseCoreKbd && other->key) || ((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
(stuff->deviceSpec == XkbUseCorePtr && other->button))) { (stuff->deviceSpec == XkbUseCorePtr && other->button))) {
@ -6970,7 +6970,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
DeviceIntPtr other; DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next) { for (other = inputInfo.devices; other; other = other->next) {
if (((other != dev) && !IsMaster(other) && if (((other != dev) && !InputDevIsMaster(other) &&
GetMaster(other, MASTER_KEYBOARD) == dev) && GetMaster(other, MASTER_KEYBOARD) == dev) &&
((stuff->deviceSpec == XkbUseCoreKbd && other->key) || ((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
(stuff->deviceSpec == XkbUseCorePtr && other->button))) { (stuff->deviceSpec == XkbUseCorePtr && other->button))) {

View File

@ -735,7 +735,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
changed |= XkbPointerButtonMask; changed |= XkbPointerButtonMask;
} }
else if (event->type == ET_ButtonRelease) { else if (event->type == ET_ButtonRelease) {
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
DeviceIntPtr source; DeviceIntPtr source;
int rc; int rc;

View File

@ -658,7 +658,7 @@ _XkbFilterPointerBtn(XkbSrvInfoPtr xkbi,
} }
xkbi->lockedPtrButtons &= ~(1 << button); xkbi->lockedPtrButtons &= ~(1 << button);
if (IsMaster(xkbi->device)) { if (InputDevIsMaster(xkbi->device)) {
XkbMergeLockedPtrBtns(xkbi->device); XkbMergeLockedPtrBtns(xkbi->device);
/* One SD still has lock set, don't post event */ /* One SD still has lock set, don't post event */
if ((xkbi->lockedPtrButtons & (1 << button)) != 0) if ((xkbi->lockedPtrButtons & (1 << button)) != 0)
@ -1564,7 +1564,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags,
DeviceIntPtr ptr, mpointer, lastSlave = NULL; DeviceIntPtr ptr, mpointer, lastSlave = NULL;
Bool saveWait; Bool saveWait;
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
mpointer = GetMaster(dev, MASTER_POINTER); mpointer = GetMaster(dev, MASTER_POINTER);
lastSlave = mpointer->lastSlave; lastSlave = mpointer->lastSlave;
ptr = GetXTestDevice(mpointer); ptr = GetXTestDevice(mpointer);
@ -1579,7 +1579,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags,
pScreen = miPointerGetScreen(ptr); pScreen = miPointerGetScreen(ptr);
saveWait = miPointerSetWaitForUpdate(pScreen, FALSE); saveWait = miPointerSetWaitForUpdate(pScreen, FALSE);
nevents = GetPointerEvents(events, ptr, type, button, flags, mask); nevents = GetPointerEvents(events, ptr, type, button, flags, mask);
if (IsMaster(dev) && (lastSlave && lastSlave != ptr)) if (InputDevIsMaster(dev) && (lastSlave && lastSlave != ptr))
UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT,
&nevents); &nevents);
miPointerSetWaitForUpdate(pScreen, saveWait); miPointerSetWaitForUpdate(pScreen, saveWait);
@ -1598,7 +1598,7 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y)
int gpe_flags = 0; int gpe_flags = 0;
/* ignore attached SDs */ /* ignore attached SDs */
if (!IsMaster(dev) && !IsFloating(dev)) if (!InputDevIsMaster(dev) && !IsFloating(dev))
return; return;
if (flags & XkbSA_MoveAbsoluteX || flags & XkbSA_MoveAbsoluteY) if (flags & XkbSA_MoveAbsoluteX || flags & XkbSA_MoveAbsoluteY)
@ -1626,7 +1626,7 @@ XkbFakeDeviceButton(DeviceIntPtr dev, Bool press, int button)
* if dev is a floating slave, post through the device itself. * if dev is a floating slave, post through the device itself.
*/ */
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
DeviceIntPtr mpointer = GetMaster(dev, MASTER_POINTER); DeviceIntPtr mpointer = GetMaster(dev, MASTER_POINTER);
ptr = GetXTestDevice(mpointer); ptr = GetXTestDevice(mpointer);

View File

@ -458,7 +458,7 @@ XkbForceUpdateDeviceLEDs(DeviceIntPtr dev)
sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0);
XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState); XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState);
if (IsMaster(dev)) { if (InputDevIsMaster(dev)) {
master = dev; master = dev;
nt_list_for_each_entry(dev, inputInfo.devices, next) { nt_list_for_each_entry(dev, inputInfo.devices, next) {
if (!dev->key || GetMaster(dev, MASTER_KEYBOARD) != master) if (!dev->key || GetMaster(dev, MASTER_KEYBOARD) != master)

View File

@ -2104,7 +2104,7 @@ XkbMergeLockedPtrBtns(DeviceIntPtr master)
DeviceIntPtr d = inputInfo.devices; DeviceIntPtr d = inputInfo.devices;
XkbSrvInfoPtr xkbi = NULL; XkbSrvInfoPtr xkbi = NULL;
if (!IsMaster(master)) if (!InputDevIsMaster(master))
return; return;
if (!master->key) if (!master->key)
@ -2114,7 +2114,7 @@ XkbMergeLockedPtrBtns(DeviceIntPtr master)
xkbi->lockedPtrButtons = 0; xkbi->lockedPtrButtons = 0;
for (; d; d = d->next) { for (; d; d = d->next) {
if (IsMaster(d) || GetMaster(d, MASTER_KEYBOARD) != master || !d->key) if (InputDevIsMaster(d) || GetMaster(d, MASTER_KEYBOARD) != master || !d->key)
continue; continue;
xkbi->lockedPtrButtons |= d->key->xkbInfo->lockedPtrButtons; xkbi->lockedPtrButtons |= d->key->xkbInfo->lockedPtrButtons;