diff --git a/Xi/exevents.c b/Xi/exevents.c index 331a35efc..5d7fcd4d7 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -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; diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index 914a09d36..747c8d815 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -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; /** diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 2d6c51eb5..c72a002e1 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -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) diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 0405550b7..ba0ef7ff9 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -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; } diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index f4df645fd..9466271fe 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -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; } diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index 3e70101be..64f1788b8 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -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; diff --git a/dix/devices.c b/dix/devices.c index 24e6f7a3c..732d595d9 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -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; diff --git a/dix/enterleave.c b/dix/enterleave.c index e485f1ceb..b814b6493 100644 --- a/dix/enterleave.c +++ b/dix/enterleave.c @@ -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 */ diff --git a/dix/events.c b/dix/events.c index 1837bf221..2e5d8e09d 100644 --- a/dix/events.c +++ b/dix/events.c @@ -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); } diff --git a/dix/getevents.c b/dix/getevents.c index ced80870c..01200faea 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -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; diff --git a/dix/input_priv.h b/dix/input_priv.h index 0960f4dae..a9f2d54e8 100644 --- a/dix/input_priv.h +++ b/dix/input_priv.h @@ -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 */ diff --git a/dix/inpututils.c b/dix/inpututils.c index ddf24866a..e71cb38b7 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -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) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index b90e07455..e2c498966 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -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)) { diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 8806678ee..92c5570a8 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -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)) { diff --git a/mi/mieq.c b/mi/mieq.c index a083eaaad..22a5c7740 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -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); } } diff --git a/mi/mipointer.c b/mi/mipointer.c index e6f29928b..965faf777 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -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); diff --git a/mi/misprite.c b/mi/misprite.c index 67357a914..403dd3e74 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -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); diff --git a/render/animcur.c b/render/animcur.c index 171f4d308..bbebcc147 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -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); diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 43774393c..d05044ee8 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -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; diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 9830e47ba..df7abd2bd 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -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;