dix: rename IsFloating() to InputDevIsFloating()

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:33:05 +02:00
parent 985f4c22c6
commit 6dc7eab871
20 changed files with 53 additions and 52 deletions

View File

@ -782,7 +782,7 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
if (InputDevIsMaster(slave))
return;
if (IsFloating(slave))
if (InputDevIsFloating(slave))
return; /* set floating since the event */
if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid)
@ -1852,7 +1852,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
b = device->button;
if (InputDevIsMaster(device) || IsFloating(device))
if (InputDevIsMaster(device) || InputDevIsFloating(device))
CheckMotion(event, device);
switch (event->type) {
@ -1955,7 +1955,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
if (deactivateDeviceGrab == TRUE) {
(*device->deviceGrab.DeactivateGrab) (device);
if (!InputDevIsMaster (device) && !IsFloating (device)) {
if (!InputDevIsMaster (device) && !InputDevIsFloating (device)) {
int flags, num_events = 0;
InternalEvent dce;

View File

@ -421,7 +421,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
if (nevents)
*nevents = 0;
if (xorg_list_is_empty(&cs->barriers) || IsFloating(dev))
if (xorg_list_is_empty(&cs->barriers) || InputDevIsFloating(dev))
goto out;
/**

View File

@ -197,7 +197,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
goto out;
}
mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
mod_dev = (InputDevIsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
for (i = 0; i < stuff->num_modifiers; i++, modifiers++) {
uint8_t status = Success;
@ -345,7 +345,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
if (rc != Success)
return rc;
mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
mod_dev = (InputDevIsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
tempGrab = AllocGrab(NULL);
if (!tempGrab)

View File

@ -521,7 +521,7 @@ GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment)
use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard;
*attachment = (paired ? paired->id : 0);
}
else if (!IsFloating(dev)) {
else if (!InputDevIsFloating(dev)) {
use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard;
*attachment = master->id;
}

View File

@ -105,7 +105,8 @@ ProcXIQueryPointer(ClientPtr client)
return rc;
}
if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || (!InputDevIsMaster(pDev) && !IsFloating(pDev))) { /* no attached devices */
if (pDev->valuator == NULL || IsKeyboardDevice(pDev) ||
(!InputDevIsMaster(pDev) && !InputDevIsFloating(pDev))) { /* no attached devices */
client->errorValue = stuff->deviceid;
return BadDevice;
}

View File

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

View File

@ -424,7 +424,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
XISendDeviceHierarchyEvent(flags);
}
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
/* Now make sure our LEDs are in sync with the locked state */
@ -1110,12 +1110,12 @@ CloseDownDevices(void)
* to NULL and pretend nothing happened.
*/
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
dev->master = NULL;
}
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
dev->master = NULL;
}
@ -2667,13 +2667,13 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
return BadDevice;
/* set from floating to floating? */
if (IsFloating(dev) && !master && dev->enabled)
if (InputDevIsFloating(dev) && !master && dev->enabled)
return Success;
input_lock();
/* free the existing sprite. */
if (IsFloating(dev) && dev->spriteInfo->paired == dev) {
if (InputDevIsFloating(dev) && dev->spriteInfo->paired == dev) {
screen = miPointerGetScreen(dev);
screen->DeviceCursorCleanup(dev, screen);
free(dev->spriteInfo->sprite);
@ -2734,7 +2734,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
DeviceIntPtr
GetPairedDevice(DeviceIntPtr dev)
{
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
dev = GetMaster(dev, MASTER_ATTACHED);
return (dev && dev->spriteInfo) ? dev->spriteInfo->paired: NULL;

View File

@ -772,10 +772,10 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
{
deviceFocus event;
xXIFocusInEvent *xi2event;
DeviceIntPtr mouse;
int btlen, len, i;
mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER);
DeviceIntPtr mouse = InputDevIsFloating(dev) ?
dev : GetMaster(dev, MASTER_POINTER);
/* XI 2 event contains the logical button map - maps are CARD8
* so we need 256 bits for the possibly maximum mapping */

View File

@ -349,7 +349,7 @@ InputDevIsMaster(DeviceIntPtr dev)
}
Bool
IsFloating(DeviceIntPtr dev)
InputDevIsFloating(DeviceIntPtr dev)
{
return !InputDevIsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == NULL;
}
@ -1393,7 +1393,7 @@ ScreenRestructured(ScreenPtr pScreen)
DeviceIntPtr pDev;
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if (!IsFloating(pDev) && !DevHasCursor(pDev))
if (!InputDevIsFloating(pDev) && !DevHasCursor(pDev))
continue;
/* GrabDevice doesn't have a confineTo field, so we don't need to
@ -1455,7 +1455,7 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
static void
DetachFromMaster(DeviceIntPtr dev)
{
if (IsFloating(dev))
if (InputDevIsFloating(dev))
return;
dev->saved_master_id = GetMaster(dev, MASTER_ATTACHED)->id;
@ -3261,7 +3261,7 @@ WindowsRestructured(void)
DeviceIntPtr pDev = inputInfo.devices;
while (pDev) {
if (InputDevIsMaster(pDev) || IsFloating(pDev))
if (InputDevIsMaster(pDev) || InputDevIsFloating(pDev))
CheckMotion(NULL, pDev);
pDev = pDev->next;
}
@ -3480,7 +3480,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
SpritePtr pSprite;
ptr =
IsFloating(pDev) ? pDev :
InputDevIsFloating(pDev) ? pDev :
GetXTestDevice(GetMaster(pDev, MASTER_POINTER));
pSprite = ptr->spriteInfo->sprite;
@ -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 (!InputDevIsMaster(grab->device) && !IsFloating(device))
if (!InputDevIsMaster(grab->device) && !InputDevIsFloating(device))
gdev = GetMaster(device, MASTER_KEYBOARD);
}

View File

@ -786,7 +786,7 @@ static void
moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
{
int i;
Bool clip_xy = InputDevIsMaster(dev) || !IsFloating(dev);
Bool clip_xy = InputDevIsMaster(dev) || !InputDevIsFloating(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 (!InputDevIsMaster(dev) && !IsFloating(dev)) {
if (!InputDevIsMaster(dev) && !InputDevIsFloating(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 (!InputDevIsMaster(pDev) && !IsFloating(pDev)) {
if (!InputDevIsMaster(pDev) && !InputDevIsFloating(pDev)) {
DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
master->last.valuators[0] = screenx;
@ -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 && !InputDevIsMaster(dev) && !IsFloating(dev)) {
if (emulate_pointer && !InputDevIsMaster(dev) && !InputDevIsFloating(dev)) {
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
master->last.valuators[0] = screenx;

View File

@ -474,7 +474,7 @@ Bool InputDevIsMaster(DeviceIntPtr dev)
* @param dev device to check
* @return TRUE if the device is in `floating` state
*/
Bool IsFloating(DeviceIntPtr dev)
Bool InputDevIsFloating(DeviceIntPtr dev)
_X_ATTRIBUTE_NONNULL_ARG(1);
#endif /* _XSERVER_INPUT_PRIV_H */

View File

@ -273,7 +273,7 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
do_modmap_change(client, tmp, modmap);
}
}
else if (!IsFloating(dev) &&
else if (!InputDevIsFloating(dev) &&
GetMaster(dev, MASTER_KEYBOARD)->lastSlave == dev) {
/* If this fails, expect the results to be weird. */
if (check_modmap_change(client, dev->master, modmap) == Success)

View File

@ -242,7 +242,7 @@ xf86RandRSetConfig(ScreenPtr pScreen,
Bool view_adjusted = FALSE;
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(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 (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
continue;
if (pScreen == miPointerGetScreen(dev)) {

View File

@ -602,7 +602,7 @@ xf86RandR12SetConfig(ScreenPtr pScreen,
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(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 (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
continue;
if (pScreen == miPointerGetScreen(dev)) {

View File

@ -399,7 +399,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
verify_internal_event(original);
/* ET_XQuartz has sdev == NULL */
if (!sdev || InputDevIsMaster(sdev) || IsFloating(sdev))
if (!sdev || InputDevIsMaster(sdev) || InputDevIsFloating(sdev))
return NULL;
#ifdef XFreeXDGA
@ -500,7 +500,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
handler(screenNum, event, dev);
/* Check for the SD's master in case the device got detached
* during event processing */
if (master && !IsFloating(dev))
if (master && !InputDevIsFloating(dev))
handler(screenNum, &mevent, master);
}
else {
@ -509,7 +509,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
/* Check for the SD's master in case the device got detached
* during event processing */
if (master && !IsFloating(dev))
if (master && !InputDevIsFloating(dev))
master->public.processInputProc(&mevent, master);
}
}

View File

@ -90,7 +90,7 @@ DevPrivateKeyRec miPointerScreenKeyRec;
DevPrivateKeyRec miPointerPrivKeyRec;
#define MIPOINTER(dev) \
(IsFloating(dev) ? \
(InputDevIsFloating(dev) ? \
(miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
(miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey))
@ -367,7 +367,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
SetupScreen(pScreen);
if (!InputDevIsMaster(pDev) && !IsFloating(pDev))
if (!InputDevIsMaster(pDev) && !InputDevIsFloating(pDev))
return;
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen);

View File

@ -148,7 +148,7 @@ GetSpriteScreen(ScreenPtr pScreen)
static miCursorInfoPtr
GetSprite(DeviceIntPtr dev)
{
if (IsFloating(dev))
if (InputDevIsFloating(dev))
return dixLookupPrivate(&dev->devPrivates, &miSpriteDevPrivatesKeyRec);
return dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates,
@ -614,7 +614,7 @@ miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return FALSE;
pCursorInfo = GetSprite(pDev);
@ -638,7 +638,7 @@ miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
miCursorInfoPtr pPointer;
miSpriteScreenPtr pScreenPriv;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
pPointer = GetSprite(pDev);
@ -690,7 +690,7 @@ miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
CursorPtr pCursor;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
pCursor = GetSprite(pDev)->pCursor;
@ -742,7 +742,7 @@ miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
DamageDrawInternal(pScreen, TRUE);
@ -777,7 +777,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
DamageDrawInternal(pScreen, TRUE);
@ -813,7 +813,7 @@ miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
DamageDrawInternal(pScreen, TRUE);
@ -852,7 +852,7 @@ miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen)
CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return;
pCursorInfo = GetSprite(pDev);

View File

@ -170,7 +170,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
Bool ret = TRUE;
if (IsFloating(pDev))
if (InputDevIsFloating(pDev))
return FALSE;
Unwrap(as, pScreen, DisplayCursor);

View File

@ -716,14 +716,14 @@ extern int xkbDevicePrivateIndex;
void
ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
{
DeviceIntPtr dev;
XkbSrvInfoPtr xkbi = NULL;
unsigned changed = 0;
ProcessInputProc backupproc;
xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
DeviceEvent *event = &ev->device_event;
dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
DeviceIntPtr dev = InputDevIsFloating(mouse)
? mouse : GetMaster(mouse, MASTER_KEYBOARD);
if (dev && dev->key) {
xkbi = dev->key->xkbInfo;

View File

@ -1569,7 +1569,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags,
lastSlave = mpointer->lastSlave;
ptr = GetXTestDevice(mpointer);
}
else if (IsFloating(dev))
else if (InputDevIsFloating(dev))
ptr = dev;
else
return;
@ -1598,7 +1598,7 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y)
int gpe_flags = 0;
/* ignore attached SDs */
if (!InputDevIsMaster(dev) && !IsFloating(dev))
if (!InputDevIsMaster(dev) && !InputDevIsFloating(dev))
return;
if (flags & XkbSA_MoveAbsoluteX || flags & XkbSA_MoveAbsoluteY)
@ -1631,7 +1631,7 @@ XkbFakeDeviceButton(DeviceIntPtr dev, Bool press, int button)
ptr = GetXTestDevice(mpointer);
}
else if (IsFloating(dev))
else if (InputDevIsFloating(dev))
ptr = dev;
else
return;