XWarpPointer(3)
π XWarpPointer(3) β Xlib functions girlie π
okay bestie, welcome to the XLIB FUNCTIONS corner of the manual. This is XWarpPointer(3) β the pointer-moving one. Buckle up, we're warping π¦
πΈ NAME πΈ
XWarpPointer β move pointer π«
β¨ SYNTAX β¨
int XWarpPointer(Display *display, Window src_w, Window dest_w, int
src_x, int src_y, unsigned int src_width, unsigned int
src_height, int dest_x, int dest_y);
π ARGUMENTS π
dest_wβ specifies the destination window orNone. π―dest_x,dest_yβ specify the x and y coordinates within the destination window. πdisplayβ specifies the connection to the X server. πsrc_x,src_y,src_width,src_heightβ specify a rectangle in the source window. πΌοΈsrc_wβ specifies the source window orNone. πͺ
π DESCRIPTION π
If dest_w is None, XWarpPointer moves the pointer by the offsets (dest_x, dest_y) relative to the current position of the pointer. If dest_w is a window, XWarpPointer moves the pointer to the offsets (dest_x, dest_y) relative to the origin of dest_w. π«Ά
But plot twist β if src_w is a window, the move only takes place if the window src_w contains the pointer and if the specified rectangle of src_w contains the pointer. So it's giving "you can only warp from the right spot, bestie" β¨
The src_x and src_y coordinates are relative to the origin of src_w. If src_height is zero, it is replaced with the current height of src_w minus src_y. If src_width is zero, it is replaced with the current width of src_w minus src_x. Math but make it pointer-core π
ngl, there is seldom any reason for calling this function. The pointer should normally be left to the user. It's very "don't touch my mouse, main character energy" π If you do use this function, however, it generates events just as if the user had instantaneously moved the pointer from one position to another. So yes, it's got receipts. π
Note that you cannot use XWarpPointer to move the pointer outside the confine_to window of an active pointer grab. An attempt to do so will only move the pointer as far as the closest edge of the confine_to window. The grab said "boundaries," periodt. π§
XWarpPointer can generate a BadWindow error. π
π DIAGNOSTICS π
BadWindowβ a value for aWindowargument does not name a definedWindow. Oop, that window is not windowing π
π¦ SEE ALSO π¦
XSetInputFocus(3)Xlib - C Language X Interface
And that's the footer receipt, bestie: X Version 11, libX11 1.8.14 β no separate date line was printed, so the version stamp is the whole flex. Stay warped (responsibly) π β¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms