Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "arrow+watch" mouse cursor, using Xlib?

Tags:

linux

xlib

I noticed, that using XCreateFontCursor and then XDefineCursor with cursor code XC_watch (150) actually sets the cursor not to the ugly Xlib cursor, but to the default system animated hourglass cursor.

For me this indicates that some system (the window manager?) intercepts the xlib calls and changes the cursors transparently.

But how I can set this way the cursor to the "arrow+hourglass" cursor, if it is not defined in XLib constants?

like image 969
johnfound Avatar asked Feb 19 '26 08:02

johnfound


1 Answers

What you're looking for is called cursor themes (which extend the X cursor font stuff, not always in a compatible manner). For some discussion:

  • X resources (Arch).
  • Cursor themes (Gentoo)
  • X11_Mouse/Cursor_Themes
  • How do I change the cursor and its size?

That's the user-level (where you can see animated cursors). The Xcursor library is used by the X server to override the older bitmap-cursor behavior to provide colors and other interesting image-related features. The documentation is ... poor, essentially requiring other developers to get most of the information by reading source-code (as I did in xterm — look for "XCursor").

Here's a pointer to the source-code:

http://cgit.freedesktop.org/xorg/lib/libXcursor/

like image 54
Thomas Dickey Avatar answered Feb 20 '26 21:02

Thomas Dickey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!