XDefineCursor(3)

πŸ’– XDefineCursor(3) β€” define cursors πŸ’–

okay bestie, welcome to the XLIB FUNCTIONS manual page for XDefineCursor and XUndefineCursor, the two functions that handle your window cursor situation. It’s giving β€œset the vibe, or undo the vibe” and honestly? iconic. πŸŽ€

🌸 NAME 🌸

XDefineCursor, XUndefineCursor β€” define cursors ✨


πŸ¦‹ SYNTAX πŸ¦‹

int XDefineCursor(Display *display, Window w, Cursor cursor);
int XUndefineCursor(Display *display, Window w);

πŸ“ ARGUMENTS πŸ“

  • cursor β€” Specifies the cursor that is to be displayed or None.
  • display β€” Specifies the connection to the X server.
  • w β€” Specifies the window.

πŸ’… DESCRIPTION πŸ’…

If a cursor is set, it will be used when the pointer is in the window. If the cursor is None, it is equivalent to XUndefineCursor. no cap, that’s the whole rule πŸ’–

XDefineCursor can generate BadCursor and BadWindow errors. so like… keep an eye on that, bestie πŸ‘€

The XUndefineCursor function undoes the effect of a previous XDefineCursor for this window. When the pointer is in the window, the parent’s cursor will now be used. On the root window, the default cursor is restored. periodt. ✨

XUndefineCursor can generate a BadWindow error.

bestie moment: XDefineCursor can throw BadCursor and BadWindow; XUndefineCursor can throw BadWindow. those are the error girlies to know about πŸ’€

πŸ’€ DIAGNOSTICS πŸ’€

  • BadAlloc β€” The server failed to allocate the requested resource or server memory.
  • BadCursor β€” A value for a Cursor argument does not name a defined Cursor.
  • BadWindow β€” A value for a Window argument does not name a defined Window.

🫢 SEE ALSO 🫢


πŸ’œ signing off from X Version 11, libX11 1.8.14 β€” it’s the XDefineCursor(3) page, and the footer didn’t include a date so I’m not gonna invent one, bestie. love u, bye πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from