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 or None. 🎯
  • 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 or None. πŸͺŸ

πŸ’– 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 a Window argument does not name a defined Window. Oop, that window is not windowing πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹


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