How to change mouse cursor to standard hand cursor

Thomas L├╝bking thomas.luebking at gmail.com
Fri Jul 17 07:31:27 PDT 2015


First of all *you* do not deploy apps with toolkits, but dynamically link those libraries so it will use the version provided by the distro.
Linux doesn't do the windows dll hell.

And yes: using a toolkit is probably a good idea.


Secondly:
-
xcb_cursor_context_t *ctx;
if (xcb_cursor_context_new(connection, defaultScreen, &ctx) >= 0) {
   xcb_cursor_t cursor = xcb_cursor_load_cursor(ctx, "pointing_hand");
   if (cursor == XCB_CURSOR_NONE) // they come with various names ...
      cursor = xcb_cursor_load_cursor(ctx, "hand2");
   if (cursor == XCB_CURSOR_NONE)
      cursor = xcb_cursor_load_cursor(ctx, "hand");
   if (cursor == XCB_CURSOR_NONE)
      cursor = xcb_cursor_load_cursor(ctx, "hand1");
   if (cursor == XCB_CURSOR_NONE)
      cursor = xcb_cursor_load_cursor(ctx, "pointer");
   if (cursor == XCB_CURSOR_NONE)
      cursor = xcb_cursor_load_cursor(ctx, "e29285e634086352946a0e7090d73106");
   if (cursor == XCB_CURSOR_NONE)
      cursor = xcb_cursor_load_cursor(ctx, "9d800788f1b08800ae810202380a0822");
   if (cursor != XCB_CURSOR_NONE) {
      xcb_change_window_attributes(connection, window, XCB_CW_CURSOR, &cursor);
   }
   xcb_cursor_context_free(ctx);
}


Thomas


More information about the xorg mailing list