IT lexicon › Programming › WarpPointer

WarpPointer

Programming På svenska → Updated: 2026-10-10

The X11 request that moves the mouse pointer on the user's behalf — technically trivial, socially fraught.

XWarpPointer moves the pointer to a position relative to a destination window, or relative to where it is now if no destination is given. A source window and rectangle can be supplied as a condition: the warp only happens if the pointer is currently inside it, a way of not yanking the mouse from a user who has already moved on. The server then generates the same motion and crossing events as if the mouse had been moved by hand.

ICCCM states plainly that clients should not, in general, warp the pointer, and with good reason: few things feel as hostile as a mouse that moves by itself. It gets used anyway. Focus-follows-mouse window managers warp the pointer into the window they just focused, and older games captured the mouse by re-centring it after every move and counting the difference — until XInput 2 and pointer barriers offered better tools.

← Back to the lexicon