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:
parent
1b3de34f22
commit
4f2bd438cd
|
@ -650,7 +650,7 @@ AllocXTestDevice(ClientPtr client, const char *name,
|
|||
BOOL
|
||||
IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master)
|
||||
{
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
return FALSE;
|
||||
|
||||
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest
|
||||
|
|
|
@ -771,7 +771,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
|
|||
int rc;
|
||||
|
||||
/* For now, we don't have devices that change physically. */
|
||||
if (!IsMaster(device))
|
||||
if (!InputDevIsMaster(device))
|
||||
return;
|
||||
|
||||
rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess);
|
||||
|
@ -779,7 +779,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
|
|||
if (rc != Success)
|
||||
return; /* Device has disappeared */
|
||||
|
||||
if (IsMaster(slave))
|
||||
if (InputDevIsMaster(slave))
|
||||
return;
|
||||
|
||||
if (IsFloating(slave))
|
||||
|
@ -966,7 +966,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
|
|||
|
||||
if (!button_is_down(device, key, BUTTON_PROCESSED))
|
||||
return DONT_PROCESS;
|
||||
if (IsMaster(device)) {
|
||||
if (InputDevIsMaster(device)) {
|
||||
DeviceIntPtr sd;
|
||||
|
||||
/*
|
||||
|
@ -975,7 +975,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
|
|||
* event being delivered through the slave first
|
||||
*/
|
||||
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;
|
||||
if (!sd->button)
|
||||
continue;
|
||||
|
@ -1676,7 +1676,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
|
|||
(ev->any.type == ET_TouchEnd && ti->num_listeners > 0)))
|
||||
DeliverEmulatedMotionEvent(dev, ti, ev);
|
||||
|
||||
if (emulate_pointer && IsMaster(dev))
|
||||
if (emulate_pointer && InputDevIsMaster(dev))
|
||||
CheckMotion(&ev->device_event, dev);
|
||||
|
||||
kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
|
||||
|
@ -1716,7 +1716,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
|
|||
int rc;
|
||||
GrabPtr grab = dev->deviceGrab.grab;
|
||||
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
return;
|
||||
|
||||
if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success)
|
||||
|
@ -1777,7 +1777,7 @@ ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev)
|
|||
if (!dev->gesture)
|
||||
return;
|
||||
|
||||
if (IsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
|
||||
if (InputDevIsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
|
||||
return;
|
||||
|
||||
if (IsGestureBeginEvent(ev))
|
||||
|
@ -1852,7 +1852,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
|
||||
b = device->button;
|
||||
|
||||
if (IsMaster(device) || IsFloating(device))
|
||||
if (InputDevIsMaster(device) || IsFloating(device))
|
||||
CheckMotion(event, device);
|
||||
|
||||
switch (event->type) {
|
||||
|
@ -1955,7 +1955,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
if (deactivateDeviceGrab == TRUE) {
|
||||
(*device->deviceGrab.DeactivateGrab) (device);
|
||||
|
||||
if (!IsMaster (device) && !IsFloating (device)) {
|
||||
if (!InputDevIsMaster (device) && !IsFloating (device)) {
|
||||
int flags, num_events = 0;
|
||||
InternalEvent dce;
|
||||
|
||||
|
|
|
@ -157,9 +157,9 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, char **buf)
|
|||
dev->id = d->id;
|
||||
dev->type = d->xinput_type;
|
||||
dev->num_classes = num_classes;
|
||||
if (IsMaster(d) && IsKeyboardDevice(d))
|
||||
if (InputDevIsMaster(d) && IsKeyboardDevice(d))
|
||||
dev->use = IsXKeyboard;
|
||||
else if (IsMaster(d) && IsPointerDevice(d))
|
||||
else if (InputDevIsMaster(d) && IsPointerDevice(d))
|
||||
dev->use = IsXPointer;
|
||||
else if (d->valuator && d->button)
|
||||
dev->use = IsXExtensionPointer;
|
||||
|
@ -294,7 +294,7 @@ static Bool
|
|||
ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
|
||||
{
|
||||
/* 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);
|
||||
|
||||
if (rc == Success)
|
||||
|
|
|
@ -97,7 +97,7 @@ ProcXOpenDevice(ClientPtr client)
|
|||
else if (status != Success)
|
||||
return status;
|
||||
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
return BadDevice;
|
||||
|
||||
if (status != Success)
|
||||
|
|
|
@ -104,15 +104,15 @@ ProcXIAllowEvents(ClientPtr client)
|
|||
AllowSome(client, time, dev, GRAB_STATE_THAWED);
|
||||
break;
|
||||
case XIAsyncPairedDevice:
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_THAW_OTHERS);
|
||||
break;
|
||||
case XISyncPair:
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_FREEZE_BOTH_NEXT_EVENT);
|
||||
break;
|
||||
case XIAsyncPair:
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
AllowSome(client, time, dev, GRAB_STATE_THAWED_BOTH);
|
||||
break;
|
||||
case XIRejectTouch:
|
||||
|
|
|
@ -599,7 +599,7 @@ CreatePointerBarrierClient(ClientPtr client,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!IsMaster (device)) {
|
||||
if (!InputDevIsMaster (device)) {
|
||||
client->errorValue = device_id;
|
||||
err = BadDevice;
|
||||
goto error;
|
||||
|
|
|
@ -80,7 +80,7 @@ ProcXIChangeCursor(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (!IsMaster(pDev) || !IsPointerDevice(pDev))
|
||||
if (!InputDevIsMaster(pDev) || !IsPointerDevice(pDev))
|
||||
return BadDevice;
|
||||
|
||||
if (stuff->win != None) {
|
||||
|
|
|
@ -236,7 +236,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!IsMaster(dev)) {
|
||||
if (!InputDevIsMaster(dev)) {
|
||||
client->errorValue = r->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
@ -285,7 +285,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!IsMaster(newptr) || !IsPointerDevice(newptr)) {
|
||||
if (!InputDevIsMaster(newptr) || !IsPointerDevice(newptr)) {
|
||||
client->errorValue = r->return_pointer;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
@ -296,14 +296,14 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!IsMaster(newkeybd) || !IsKeyboardDevice(newkeybd)) {
|
||||
if (!InputDevIsMaster(newkeybd) || !IsKeyboardDevice(newkeybd)) {
|
||||
client->errorValue = r->return_keyboard;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
for (attached = inputInfo.devices; attached; attached = attached->next) {
|
||||
if (!IsMaster(attached)) {
|
||||
if (!InputDevIsMaster(attached)) {
|
||||
if (GetMaster(attached, MASTER_ATTACHED) == ptr) {
|
||||
AttachDevice(client, attached, newptr);
|
||||
flags[attached->id] |= XISlaveAttached;
|
||||
|
@ -354,7 +354,7 @@ detach_slave(ClientPtr client, xXIDetachSlaveInfo * c, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
client->errorValue = c->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
@ -386,7 +386,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
client->errorValue = c->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
@ -402,7 +402,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
|
|||
rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
if (!IsMaster(newmaster)) {
|
||||
if (!InputDevIsMaster(newmaster)) {
|
||||
client->errorValue = c->new_master;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
|
|
@ -84,7 +84,7 @@ ProcXIGrabDevice(ClientPtr client)
|
|||
if (!dev->enabled)
|
||||
return AlreadyGrabbed;
|
||||
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
stuff->paired_device_mode = GrabModeAsync;
|
||||
|
||||
if (IsKeyboardDevice(dev)) {
|
||||
|
|
|
@ -176,7 +176,7 @@ static Bool
|
|||
ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev)
|
||||
{
|
||||
/* 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);
|
||||
|
||||
if (rc == Success)
|
||||
|
@ -515,7 +515,7 @@ GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment)
|
|||
DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED);
|
||||
int use;
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
DeviceIntPtr paired = GetPairedDevice(dev);
|
||||
|
||||
use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard;
|
||||
|
|
|
@ -105,7 +105,7 @@ ProcXIQueryPointer(ClientPtr client)
|
|||
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;
|
||||
return BadDevice;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ ProcXIQueryPointer(ClientPtr client)
|
|||
if (pDev->valuator->motionHintWindow)
|
||||
MaybeStopHint(pDev, client);
|
||||
|
||||
if (IsMaster(pDev))
|
||||
if (InputDevIsMaster(pDev))
|
||||
kbd = GetMaster(pDev, MASTER_KEYBOARD);
|
||||
else
|
||||
kbd = (pDev->key) ? pDev : NULL;
|
||||
|
|
|
@ -74,7 +74,7 @@ ProcXISetClientPointer(ClientPtr client)
|
|||
return rc;
|
||||
}
|
||||
|
||||
if (!IsMaster(pDev)) {
|
||||
if (!InputDevIsMaster(pDev)) {
|
||||
client->errorValue = stuff->deviceid;
|
||||
return BadDevice;
|
||||
}
|
||||
|
|
|
@ -98,8 +98,8 @@ ProcXIWarpPointer(ClientPtr client)
|
|||
return rc;
|
||||
}
|
||||
|
||||
if ((!IsMaster(pDev) && !IsFloating(pDev)) ||
|
||||
(IsMaster(pDev) && !IsPointerDevice(pDev))) {
|
||||
if ((!InputDevIsMaster(pDev) && !IsFloating(pDev)) ||
|
||||
(InputDevIsMaster(pDev) && !IsPointerDevice(pDev))) {
|
||||
client->errorValue = stuff->deviceid;
|
||||
return BadDevice;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd)
|
|||
return BadDevice;
|
||||
|
||||
/* Don't allow pairing for slave devices */
|
||||
if (!IsMaster(ptr) || !IsMaster(kbd))
|
||||
if (!InputDevIsMaster(ptr) || !InputDevIsMaster(kbd))
|
||||
return BadDevice;
|
||||
|
||||
if (ptr->spriteInfo->paired)
|
||||
|
@ -225,7 +225,7 @@ NextFreePointerDevice(void)
|
|||
DeviceIntPtr dev;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
if (IsMaster(dev) &&
|
||||
if (InputDevIsMaster(dev) &&
|
||||
dev->spriteInfo->spriteOwner && !dev->spriteInfo->paired)
|
||||
return dev;
|
||||
return NULL;
|
||||
|
@ -375,7 +375,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
*prev && (*prev != dev); prev = &(*prev)->next);
|
||||
|
||||
if (!dev->spriteInfo->sprite) {
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
/* Sprites appear on first root window, so we can hardcode it */
|
||||
if (dev->spriteInfo->spriteOwner) {
|
||||
InitializeSprite(dev, screenInfo.screens[0]->root);
|
||||
|
@ -424,7 +424,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
XISendDeviceHierarchyEvent(flags);
|
||||
}
|
||||
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* float attached devices */
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
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);
|
||||
flags[other->id] |= XISlaveDetached;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
flags[other->id] |= XISlaveDetached;
|
||||
}
|
||||
|
@ -495,12 +495,12 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
}
|
||||
else {
|
||||
for (other = inputInfo.devices; other; other = other->next) {
|
||||
if (IsMaster(other) && other->lastSlave == dev)
|
||||
if (InputDevIsMaster(other) && other->lastSlave == dev)
|
||||
other->lastSlave = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMaster(dev) && dev->spriteInfo->sprite) {
|
||||
if (InputDevIsMaster(dev) && dev->spriteInfo->sprite) {
|
||||
for (other = inputInfo.devices; other; other = other->next)
|
||||
if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
|
||||
DisableDevice(other, sendevent);
|
||||
|
@ -556,17 +556,17 @@ DisableAllDevices(void)
|
|||
|
||||
/* Disable slave devices first, excluding XTest devices */
|
||||
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);
|
||||
}
|
||||
/* Disable XTest devices */
|
||||
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
DisableDevice(dev, FALSE);
|
||||
}
|
||||
/* master keyboards need to be disabled first */
|
||||
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);
|
||||
}
|
||||
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
|
||||
|
@ -602,7 +602,7 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
return ret;
|
||||
|
||||
/* Initialize memory for sprites. */
|
||||
if (IsMaster(dev) && dev->spriteInfo->spriteOwner)
|
||||
if (InputDevIsMaster(dev) && dev->spriteInfo->spriteOwner)
|
||||
if (!pScreen->DeviceCursorInitialize(dev, pScreen))
|
||||
ret = BadAlloc;
|
||||
|
||||
|
@ -1023,7 +1023,7 @@ CloseDevice(DeviceIntPtr dev)
|
|||
|
||||
FreeSprite(dev);
|
||||
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
screen->DeviceCursorCleanup(dev, screen);
|
||||
|
||||
/* free acceleration info */
|
||||
|
@ -1038,7 +1038,7 @@ CloseDevice(DeviceIntPtr dev)
|
|||
classes = (ClassesPtr) &dev->key;
|
||||
FreeAllDeviceClasses(classes);
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
classes = dev->unused_classes;
|
||||
FreeAllDeviceClasses(classes);
|
||||
free(classes);
|
||||
|
@ -1110,12 +1110,12 @@ CloseDownDevices(void)
|
|||
* to NULL and pretend nothing happened.
|
||||
*/
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
dev->master = NULL;
|
||||
}
|
||||
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
dev->master = NULL;
|
||||
}
|
||||
|
||||
|
@ -1151,12 +1151,12 @@ AbortDevices(void)
|
|||
* cause a dead-lock.
|
||||
*/
|
||||
nt_list_for_each_entry(dev, inputInfo.devices, next) {
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
(*dev->deviceProc) (dev, DEVICE_ABORT);
|
||||
}
|
||||
|
||||
nt_list_for_each_entry(dev, inputInfo.off_devices, next) {
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
(*dev->deviceProc) (dev, DEVICE_ABORT);
|
||||
}
|
||||
}
|
||||
|
@ -1234,7 +1234,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
flags[dev->id] = XIDeviceDisabled;
|
||||
}
|
||||
|
||||
flag = IsMaster(dev) ? XIMasterRemoved : XISlaveRemoved;
|
||||
flag = InputDevIsMaster(dev) ? XIMasterRemoved : XISlaveRemoved;
|
||||
|
||||
input_lock();
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
|
|||
|
||||
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))
|
||||
InitPointerAccelerationScheme(dev, PtrAccelNoOp);
|
||||
else
|
||||
|
@ -1444,7 +1444,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme)
|
|||
if (!val)
|
||||
return FALSE;
|
||||
|
||||
if (IsMaster(dev) && scheme != PtrAccelNoOp)
|
||||
if (InputDevIsMaster(dev) && scheme != PtrAccelNoOp)
|
||||
return FALSE;
|
||||
|
||||
for (x = 0; pointerAccelerationScheme[x].number >= 0; x++) {
|
||||
|
@ -1869,7 +1869,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
|
|||
stuff->keyCodes, NULL, client);
|
||||
|
||||
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;
|
||||
if (!tmp->key)
|
||||
continue;
|
||||
|
@ -2222,7 +2222,7 @@ ProcChangeKeyboardControl(ClientPtr client)
|
|||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||
if ((pDev == keyboard ||
|
||||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
(!InputDevIsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
ret = XaceHookDeviceAccess(client, pDev, DixManageAccess);
|
||||
if (ret != Success)
|
||||
|
@ -2232,7 +2232,7 @@ ProcChangeKeyboardControl(ClientPtr client)
|
|||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||
if ((pDev == keyboard ||
|
||||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
(!InputDevIsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
|
||||
if (ret != Success)
|
||||
|
@ -2298,7 +2298,7 @@ ProcBell(ClientPtr client)
|
|||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
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)) {
|
||||
|
||||
rc = XaceHookDeviceAccess(client, dev, DixBellAccess);
|
||||
|
@ -2372,7 +2372,7 @@ ProcChangePointerControl(ClientPtr client)
|
|||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if ((dev == mouse ||
|
||||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
(!InputDevIsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
dev->ptrfeed) {
|
||||
rc = XaceHookDeviceAccess(client, dev, DixManageAccess);
|
||||
if (rc != Success)
|
||||
|
@ -2382,7 +2382,7 @@ ProcChangePointerControl(ClientPtr client)
|
|||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if ((dev == mouse ||
|
||||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
(!InputDevIsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
dev->ptrfeed) {
|
||||
dev->ptrfeed->ctrl = ctrl;
|
||||
}
|
||||
|
@ -2546,7 +2546,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
|||
DeviceIntPtr dev, master;
|
||||
int maxbuttons = 0;
|
||||
|
||||
if (!slave->button || IsMaster(slave))
|
||||
if (!slave->button || InputDevIsMaster(slave))
|
||||
return;
|
||||
|
||||
master = GetMaster(slave, MASTER_POINTER);
|
||||
|
@ -2554,7 +2554,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
|||
return;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (IsMaster(dev) ||
|
||||
if (InputDevIsMaster(dev) ||
|
||||
GetMaster(dev, MASTER_ATTACHED) != master || !dev->button)
|
||||
continue;
|
||||
|
||||
|
@ -2660,10 +2660,10 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
|
|||
{
|
||||
ScreenPtr screen;
|
||||
|
||||
if (!dev || IsMaster(dev))
|
||||
if (!dev || InputDevIsMaster(dev))
|
||||
return BadDevice;
|
||||
|
||||
if (master && !IsMaster(master)) /* can't attach to slaves */
|
||||
if (master && !InputDevIsMaster(master)) /* can't attach to slaves */
|
||||
return BadDevice;
|
||||
|
||||
/* set from floating to floating? */
|
||||
|
@ -2734,7 +2734,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
|
|||
DeviceIntPtr
|
||||
GetPairedDevice(DeviceIntPtr dev)
|
||||
{
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
dev = GetMaster(dev, MASTER_ATTACHED);
|
||||
|
||||
return (dev && dev->spriteInfo) ? dev->spriteInfo->paired: NULL;
|
||||
|
@ -2763,7 +2763,7 @@ GetMaster(DeviceIntPtr dev, int which)
|
|||
{
|
||||
DeviceIntPtr master;
|
||||
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
master = dev;
|
||||
else {
|
||||
master = dev->master;
|
||||
|
@ -2859,7 +2859,7 @@ AllocDevicePair(ClientPtr client, const char *name,
|
|||
keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE;
|
||||
|
||||
/* The ClassesRec stores the device classes currently not used. */
|
||||
if (IsMaster(pointer)) {
|
||||
if (InputDevIsMaster(pointer)) {
|
||||
pointer->unused_classes = calloc(1, sizeof(ClassesRec));
|
||||
keyboard->unused_classes = calloc(1, sizeof(ClassesRec));
|
||||
}
|
||||
|
|
|
@ -540,7 +540,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev, WindowPtr A, WindowPtr B, int mode)
|
|||
static void
|
||||
CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
||||
{
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
return;
|
||||
|
||||
LeaveWindow(dev);
|
||||
|
@ -1396,7 +1396,7 @@ CoreFocusFromPointerRootOrNone(DeviceIntPtr dev,
|
|||
static void
|
||||
CoreFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
||||
{
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
return;
|
||||
|
||||
SetFocusOut(dev);
|
||||
|
|
28
dix/events.c
28
dix/events.c
|
@ -343,7 +343,7 @@ IsKeyboardDevice(DeviceIntPtr dev)
|
|||
}
|
||||
|
||||
Bool
|
||||
IsMaster(DeviceIntPtr dev)
|
||||
InputDevIsMaster(DeviceIntPtr dev)
|
||||
{
|
||||
return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ IsMaster(DeviceIntPtr dev)
|
|||
Bool
|
||||
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;
|
||||
}
|
||||
|
||||
if (IsMaster(thisDev)) {
|
||||
if (InputDevIsMaster(thisDev)) {
|
||||
dev = GetPairedDevice(thisDev);
|
||||
if (otherMode == GrabModeSync)
|
||||
dev->deviceGrab.sync.other = grab;
|
||||
|
@ -1468,7 +1468,7 @@ ReattachToOldMaster(DeviceIntPtr dev)
|
|||
{
|
||||
DeviceIntPtr master = NULL;
|
||||
|
||||
if (IsMaster(dev))
|
||||
if (InputDevIsMaster(dev))
|
||||
return;
|
||||
|
||||
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. */
|
||||
if (grab->grabtype == XI2 &&
|
||||
!(autoGrab & ImplicitGrabMask) && !IsMaster(mouse))
|
||||
!(autoGrab & ImplicitGrabMask) && !InputDevIsMaster(mouse))
|
||||
DetachFromMaster(mouse);
|
||||
|
||||
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. */
|
||||
if (grab->grabtype == XI2 && keybd->enabled &&
|
||||
!(passive & ImplicitGrabMask) && !IsMaster(keybd))
|
||||
!(passive & ImplicitGrabMask) && !InputDevIsMaster(keybd))
|
||||
DetachFromMaster(keybd);
|
||||
|
||||
if (!keybd->enabled)
|
||||
|
@ -2901,7 +2901,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
|
|||
}
|
||||
|
||||
/* Core event */
|
||||
if ((mask & EVENT_CORE_MASK) && IsMaster(dev) && dev->coreEvents) {
|
||||
if ((mask & EVENT_CORE_MASK) && InputDevIsMaster(dev) && dev->coreEvents) {
|
||||
deliveries =
|
||||
DeliverOneEvent(event, dev, CORE, pWin, child, grab);
|
||||
if (deliveries > 0)
|
||||
|
@ -3261,7 +3261,7 @@ WindowsRestructured(void)
|
|||
DeviceIntPtr pDev = inputInfo.devices;
|
||||
|
||||
while (pDev) {
|
||||
if (IsMaster(pDev) || IsFloating(pDev))
|
||||
if (InputDevIsMaster(pDev) || IsFloating(pDev))
|
||||
CheckMotion(NULL, pDev);
|
||||
pDev = pDev->next;
|
||||
}
|
||||
|
@ -3967,7 +3967,7 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
|
|||
* attached master keyboard. Since the slave may have been
|
||||
* reattached after the grab, the modifier device may not be the
|
||||
* same. */
|
||||
if (!IsMaster(grab->device) && !IsFloating(device))
|
||||
if (!InputDevIsMaster(grab->device) && !IsFloating(device))
|
||||
gdev = GetMaster(device, MASTER_KEYBOARD);
|
||||
}
|
||||
|
||||
|
@ -4126,7 +4126,7 @@ CheckDeviceGrabs(DeviceIntPtr device, InternalEvent *ievent, WindowPtr ancestor)
|
|||
WindowPtr pWin = NULL;
|
||||
FocusClassPtr focus =
|
||||
IsPointerEvent(ievent) ? NULL : device->focus;
|
||||
BOOL sendCore = (IsMaster(device) && device->coreEvents);
|
||||
BOOL sendCore = (InputDevIsMaster(device) && device->coreEvents);
|
||||
Bool ret = FALSE;
|
||||
DeviceEvent *event = &ievent->device_event;
|
||||
|
||||
|
@ -4195,7 +4195,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
|
|||
{
|
||||
DeviceIntPtr ptr;
|
||||
WindowPtr focus = keybd->focus->win;
|
||||
BOOL sendCore = (IsMaster(keybd) && keybd->coreEvents);
|
||||
BOOL sendCore = (InputDevIsMaster(keybd) && keybd->coreEvents);
|
||||
xEvent *core = NULL, *xE = NULL, *xi2 = NULL;
|
||||
int count, rc;
|
||||
int deliveries = 0;
|
||||
|
@ -4390,7 +4390,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
|
|||
thisDev);
|
||||
}
|
||||
if (!deliveries) {
|
||||
sendCore = (IsMaster(thisDev) && thisDev->coreEvents);
|
||||
sendCore = (InputDevIsMaster(thisDev) && thisDev->coreEvents);
|
||||
/* try core event */
|
||||
if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE)
|
||||
deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype);
|
||||
|
@ -6158,7 +6158,7 @@ SetClientPointer(ClientPtr client, DeviceIntPtr device)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (!IsMaster(device)) {
|
||||
if (!InputDevIsMaster(device)) {
|
||||
ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n");
|
||||
return BadDevice;
|
||||
}
|
||||
|
@ -6197,7 +6197,7 @@ PickPointer(ClientPtr client)
|
|||
if (!client->clientPtr) {
|
||||
it = inputInfo.devices;
|
||||
while (it) {
|
||||
if (IsMaster(it) && it->spriteInfo->spriteOwner) {
|
||||
if (InputDevIsMaster(it) && it->spriteInfo->spriteOwner) {
|
||||
client->clientPtr = it;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ AllocateMotionHistory(DeviceIntPtr pDev)
|
|||
* potential valuators, plus the respective range of the valuators.
|
||||
* 3 * INT32 for (min_val, max_val, curr_val))
|
||||
*/
|
||||
if (IsMaster(pDev))
|
||||
if (InputDevIsMaster(pDev))
|
||||
size = sizeof(INT32) * 3 * MAX_VALUATORS;
|
||||
else {
|
||||
ValuatorClassPtr v = pDev->valuator;
|
||||
|
@ -427,7 +427,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start,
|
|||
if (core && !pScreen)
|
||||
return 0;
|
||||
|
||||
if (IsMaster(pDev))
|
||||
if (InputDevIsMaster(pDev))
|
||||
size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time);
|
||||
else
|
||||
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));
|
||||
|
||||
}
|
||||
else if (IsMaster(pDev)) {
|
||||
else if (InputDevIsMaster(pDev)) {
|
||||
memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */
|
||||
|
||||
ocbuf = (INT32 *) (obuff + sizeof(Time));
|
||||
|
@ -551,7 +551,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
|
|||
return;
|
||||
|
||||
v = pDev->valuator;
|
||||
if (IsMaster(pDev)) {
|
||||
if (InputDevIsMaster(pDev)) {
|
||||
buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) *
|
||||
v->last_motion;
|
||||
|
||||
|
@ -786,7 +786,7 @@ static void
|
|||
moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
|
||||
{
|
||||
int i;
|
||||
Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
|
||||
Bool clip_xy = InputDevIsMaster(dev) || !IsFloating(dev);
|
||||
ValuatorClassPtr v = dev->valuator;
|
||||
|
||||
/* 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;
|
||||
|
||||
updateMotionHistory(dev, ms, mask, dev->last.valuators);
|
||||
if (!IsMaster(dev) && !IsFloating(dev)) {
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev)) {
|
||||
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
|
||||
|
||||
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);
|
||||
|
||||
/* 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);
|
||||
|
||||
master->last.valuators[0] = screenx;
|
||||
|
@ -1972,7 +1972,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
|
|||
|
||||
emulate_pointer = ti->emulate_pointer;
|
||||
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
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);
|
||||
|
||||
/* 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);
|
||||
|
||||
master->last.valuators[0] = screenx;
|
||||
|
@ -2224,7 +2224,7 @@ GetGestureEvents(InternalEvent *events, DeviceIntPtr dev,
|
|||
if (!dev->enabled || !g)
|
||||
return 0;
|
||||
|
||||
if (!IsMaster(dev))
|
||||
if (!InputDevIsMaster(dev))
|
||||
events = UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT,
|
||||
&num_events);
|
||||
|
||||
|
|
|
@ -451,12 +451,12 @@ GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice)
|
|||
}
|
||||
else if (pFirstGrab->device == inputInfo.all_master_devices) {
|
||||
if (pSecondGrab->device != inputInfo.all_master_devices &&
|
||||
!IsMaster(pSecondGrab->device))
|
||||
!InputDevIsMaster(pSecondGrab->device))
|
||||
return FALSE;
|
||||
}
|
||||
else if (pSecondGrab->device == inputInfo.all_master_devices) {
|
||||
if (pFirstGrab->device != inputInfo.all_master_devices &&
|
||||
!IsMaster(pFirstGrab->device))
|
||||
!InputDevIsMaster(pFirstGrab->device))
|
||||
return FALSE;
|
||||
}
|
||||
else if (pSecondGrab->device != pFirstGrab->device)
|
||||
|
|
|
@ -461,7 +461,7 @@ Bool IsKeyboardDevice(DeviceIntPtr dev)
|
|||
* @param dev device to be checked
|
||||
* @return TRUE if the device is a master
|
||||
*/
|
||||
Bool IsMaster(DeviceIntPtr dev)
|
||||
Bool InputDevIsMaster(DeviceIntPtr dev)
|
||||
_X_ATTRIBUTE_NONNULL_ARG(1);
|
||||
|
||||
#endif /* _XSERVER_INPUT_PRIV_H */
|
||||
|
|
|
@ -266,9 +266,9 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
|
|||
do_modmap_change(client, dev, modmap);
|
||||
|
||||
/* Change any attached masters/slaves. */
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
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))
|
||||
do_modmap_change(client, tmp, modmap);
|
||||
}
|
||||
|
@ -1158,7 +1158,7 @@ xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type)
|
|||
set = 1;
|
||||
else if (xi2mask_isset_for_device(mask, dev, event_type))
|
||||
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;
|
||||
|
||||
return set;
|
||||
|
|
|
@ -724,7 +724,7 @@ TouchAddPassiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
WindowPtr win, InternalEvent *ev)
|
||||
{
|
||||
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 */
|
||||
grab = CheckPassiveGrabsOnWindow(win, dev, ev, check_core, FALSE);
|
||||
|
@ -797,7 +797,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
OtherClients *oclients;
|
||||
|
||||
/* window owner */
|
||||
if (IsMaster(dev) && (win->eventMask & core_filter)) {
|
||||
if (InputDevIsMaster(dev) && (win->eventMask & core_filter)) {
|
||||
TouchEventHistoryAllocate(ti);
|
||||
TouchAddListener(ti, win->drawable.id, X11_RESTYPE_WINDOW, CORE,
|
||||
TOUCH_LISTENER_POINTER_REGULAR,
|
||||
|
|
|
@ -1003,7 +1003,7 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
|
|||
|
||||
UpdateDeviceState(keybd, &ev);
|
||||
|
||||
if (!IsMaster(keybd))
|
||||
if (!InputDevIsMaster(keybd))
|
||||
return;
|
||||
|
||||
/*
|
||||
|
@ -1057,7 +1057,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
|
|||
|
||||
UpdateDeviceState(mouse, &ev);
|
||||
|
||||
if (!IsMaster(mouse))
|
||||
if (!InputDevIsMaster(mouse))
|
||||
return;
|
||||
|
||||
/*
|
||||
|
|
|
@ -242,7 +242,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
|
|||
Bool view_adjusted = FALSE;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
|
||||
|
@ -314,7 +314,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
|
|||
* FIXME: duplicated code, see modes/xf86RandR12.c
|
||||
*/
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
if (pScreen == miPointerGetScreen(dev)) {
|
||||
|
@ -325,7 +325,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
|
|||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
|
||||
/* Setting the viewpoint makes only sense on one device */
|
||||
if (!view_adjusted && IsMaster(dev)) {
|
||||
if (!view_adjusted && InputDevIsMaster(dev)) {
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
view_adjusted = TRUE;
|
||||
}
|
||||
|
|
|
@ -1138,7 +1138,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
|
|||
{
|
||||
InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate;
|
||||
InputDriverPtr drv = NULL;
|
||||
Bool isMaster = IsMaster(pDev);
|
||||
Bool isMaster = InputDevIsMaster(pDev);
|
||||
|
||||
if (pInfo) /* need to get these before RemoveDevice */
|
||||
drv = pInfo->drv;
|
||||
|
|
|
@ -602,7 +602,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
|
|||
}
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
|
||||
|
@ -650,7 +650,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
|
|||
* FIXME: duplicated code, see modes/xf86RandR12.c
|
||||
*/
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
if (pScreen == miPointerGetScreen(dev)) {
|
||||
|
@ -661,7 +661,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
|
|||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
|
||||
/* Setting the viewpoint makes only sense on one device */
|
||||
if (!view_adjusted && IsMaster(dev)) {
|
||||
if (!view_adjusted && InputDevIsMaster(dev)) {
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
view_adjusted = TRUE;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include <X11/extensions/geproto.h>
|
||||
|
||||
#include "dix/cursor_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
#include "mi/mipointer_priv.h"
|
||||
#include "os/bug_priv.h"
|
||||
|
@ -398,7 +399,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
|
|||
verify_internal_event(original);
|
||||
|
||||
/* ET_XQuartz has sdev == NULL */
|
||||
if (!sdev || IsMaster(sdev) || IsFloating(sdev))
|
||||
if (!sdev || InputDevIsMaster(sdev) || IsFloating(sdev))
|
||||
return NULL;
|
||||
|
||||
#ifdef XFreeXDGA
|
||||
|
|
|
@ -367,7 +367,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
{
|
||||
SetupScreen(pScreen);
|
||||
|
||||
if (!IsMaster(pDev) && !IsFloating(pDev))
|
||||
if (!InputDevIsMaster(pDev) && !IsFloating(pDev))
|
||||
return;
|
||||
|
||||
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen);
|
||||
|
|
|
@ -782,7 +782,7 @@ RecordADeviceEvent(CallbackListPtr *pcbl, void *nulldata, void *calldata)
|
|||
xEvent *xi_events = NULL;
|
||||
|
||||
/* TODO check return values */
|
||||
if (IsMaster(pei->device)) {
|
||||
if (InputDevIsMaster(pei->device)) {
|
||||
xEvent *core_events;
|
||||
|
||||
EventToCore(pei->event, &core_events, &count);
|
||||
|
|
|
@ -877,7 +877,7 @@ ProcXFixesHideCursor(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (IsMaster(dev) && IsPointerDevice(dev))
|
||||
if (InputDevIsMaster(dev) && IsPointerDevice(dev))
|
||||
CursorDisplayCursor(dev, pWin->drawable.pScreen,
|
||||
CursorForDevice(dev));
|
||||
}
|
||||
|
@ -968,7 +968,7 @@ CursorFreeHideCount(void *data, XID id)
|
|||
|
||||
deleteCursorHideCount(pChc, pChc->pScreen);
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (IsMaster(dev) && IsPointerDevice(dev))
|
||||
if (InputDevIsMaster(dev) && IsPointerDevice(dev))
|
||||
CursorDisplayCursor(dev, pScreen, CursorForDevice(dev));
|
||||
}
|
||||
|
||||
|
|
30
xkb/xkb.c
30
xkb/xkb.c
|
@ -560,7 +560,7 @@ ProcXkbBell(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixBellAccess);
|
||||
if (rc == Success)
|
||||
|
@ -644,7 +644,7 @@ ProcXkbLatchLockState(ClientPtr client)
|
|||
|
||||
for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
|
||||
if ((tmpd == dev) ||
|
||||
(!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
|
||||
(!InputDevIsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
|
||||
if (!tmpd->key || !tmpd->key->xkbInfo)
|
||||
continue;
|
||||
|
||||
|
@ -789,7 +789,7 @@ ProcXkbSetControls(ClientPtr client)
|
|||
if (!tmpd->key || !tmpd->key->xkbInfo)
|
||||
continue;
|
||||
if ((tmpd == dev) ||
|
||||
(!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
|
||||
(!InputDevIsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
|
||||
xkbi = tmpd->key->xkbInfo;
|
||||
ctrl = xkbi->desc->ctrls;
|
||||
new = *ctrl;
|
||||
|
@ -2747,7 +2747,7 @@ ProcXkbSetMap(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
if (rc == Success) {
|
||||
|
@ -2780,7 +2780,7 @@ ProcXkbSetMap(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
if (rc == Success)
|
||||
|
@ -3119,7 +3119,7 @@ ProcXkbSetCompatMap(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
if (rc == Success) {
|
||||
|
@ -3140,7 +3140,7 @@ ProcXkbSetCompatMap(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
if (rc == Success) {
|
||||
|
@ -3401,7 +3401,7 @@ ProcXkbSetIndicatorMap(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixSetAttrAccess);
|
||||
if (rc == Success)
|
||||
|
@ -3665,7 +3665,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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 ||
|
||||
other->leds) &&
|
||||
(XaceHookDeviceAccess(client, other, DixSetAttrAccess)
|
||||
|
@ -3689,7 +3689,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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 ||
|
||||
other->leds) &&
|
||||
(XaceHookDeviceAccess(client, other, DixSetAttrAccess)
|
||||
|
@ -4528,7 +4528,7 @@ ProcXkbSetNames(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
|
@ -4551,7 +4551,7 @@ ProcXkbSetNames(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
|
@ -5684,7 +5684,7 @@ ProcXkbSetGeometry(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
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) {
|
||||
rc = XaceHookDeviceAccess(client, other, DixManageAccess);
|
||||
if (rc == Success)
|
||||
|
@ -6946,7 +6946,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
for (other = inputInfo.devices; other; other = other->next) {
|
||||
if (((other != dev) && !IsMaster(other) &&
|
||||
if (((other != dev) && !InputDevIsMaster(other) &&
|
||||
GetMaster(other, MASTER_KEYBOARD) == dev) &&
|
||||
((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
|
||||
(stuff->deviceSpec == XkbUseCorePtr && other->button))) {
|
||||
|
@ -6970,7 +6970,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
|
|||
DeviceIntPtr other;
|
||||
|
||||
for (other = inputInfo.devices; other; other = other->next) {
|
||||
if (((other != dev) && !IsMaster(other) &&
|
||||
if (((other != dev) && !InputDevIsMaster(other) &&
|
||||
GetMaster(other, MASTER_KEYBOARD) == dev) &&
|
||||
((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
|
||||
(stuff->deviceSpec == XkbUseCorePtr && other->button))) {
|
||||
|
|
|
@ -735,7 +735,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
|
|||
changed |= XkbPointerButtonMask;
|
||||
}
|
||||
else if (event->type == ET_ButtonRelease) {
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
DeviceIntPtr source;
|
||||
int rc;
|
||||
|
||||
|
|
|
@ -658,7 +658,7 @@ _XkbFilterPointerBtn(XkbSrvInfoPtr xkbi,
|
|||
}
|
||||
xkbi->lockedPtrButtons &= ~(1 << button);
|
||||
|
||||
if (IsMaster(xkbi->device)) {
|
||||
if (InputDevIsMaster(xkbi->device)) {
|
||||
XkbMergeLockedPtrBtns(xkbi->device);
|
||||
/* One SD still has lock set, don't post event */
|
||||
if ((xkbi->lockedPtrButtons & (1 << button)) != 0)
|
||||
|
@ -1564,7 +1564,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags,
|
|||
DeviceIntPtr ptr, mpointer, lastSlave = NULL;
|
||||
Bool saveWait;
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
mpointer = GetMaster(dev, MASTER_POINTER);
|
||||
lastSlave = mpointer->lastSlave;
|
||||
ptr = GetXTestDevice(mpointer);
|
||||
|
@ -1579,7 +1579,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags,
|
|||
pScreen = miPointerGetScreen(ptr);
|
||||
saveWait = miPointerSetWaitForUpdate(pScreen, FALSE);
|
||||
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,
|
||||
&nevents);
|
||||
miPointerSetWaitForUpdate(pScreen, saveWait);
|
||||
|
@ -1598,7 +1598,7 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y)
|
|||
int gpe_flags = 0;
|
||||
|
||||
/* ignore attached SDs */
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
if (!InputDevIsMaster(dev) && !IsFloating(dev))
|
||||
return;
|
||||
|
||||
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 (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
DeviceIntPtr mpointer = GetMaster(dev, MASTER_POINTER);
|
||||
|
||||
ptr = GetXTestDevice(mpointer);
|
||||
|
|
|
@ -458,7 +458,7 @@ XkbForceUpdateDeviceLEDs(DeviceIntPtr dev)
|
|||
sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0);
|
||||
XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState);
|
||||
|
||||
if (IsMaster(dev)) {
|
||||
if (InputDevIsMaster(dev)) {
|
||||
master = dev;
|
||||
nt_list_for_each_entry(dev, inputInfo.devices, next) {
|
||||
if (!dev->key || GetMaster(dev, MASTER_KEYBOARD) != master)
|
||||
|
|
|
@ -2104,7 +2104,7 @@ XkbMergeLockedPtrBtns(DeviceIntPtr master)
|
|||
DeviceIntPtr d = inputInfo.devices;
|
||||
XkbSrvInfoPtr xkbi = NULL;
|
||||
|
||||
if (!IsMaster(master))
|
||||
if (!InputDevIsMaster(master))
|
||||
return;
|
||||
|
||||
if (!master->key)
|
||||
|
@ -2114,7 +2114,7 @@ XkbMergeLockedPtrBtns(DeviceIntPtr master)
|
|||
xkbi->lockedPtrButtons = 0;
|
||||
|
||||
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;
|
||||
|
||||
xkbi->lockedPtrButtons |= d->key->xkbInfo->lockedPtrButtons;
|
||||
|
|
Loading…
Reference in New Issue