Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Xlib hide mouse pointer


    how can i hide mouse pointer icon with Xlib programming? I'm doing some GUI stuff for touchscreen in Xlib and i just want to use mouse events but without pointer icon. How to do this? Is there any Xlib function to solve this?

  2. #2
    Linux User
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    401
    Et voilą!

    Code:
    Pixmap bm_no;
            Colormap cmap;
            Cursor no_ptr;
            XColor black, dummy;
            static char bm_no_data[] = {0, 0, 0, 0, 0, 0, 0, 0};
    
            assert(display != NULL);
    
            cmap = DefaultColormap(display, DefaultScreen(display));
            XAllocNamedColor(display, cmap, "black", &black, &dummy);
            bm_no = XCreateBitmapFromData(display, window, bm_no_data, 8, 8);
            no_ptr = XCreatePixmapCursor(display, bm_no, bm_no, &black, &black, 0, 0);
    
            XDefineCursor(display, window, no_ptr);
            XFreeCursor(display, no_ptr);
            if (bm_no != None)
                    XFreePixmap(display, bm_no);
            XFreeColors(display, cmap, &black.pixel, 1, 0);
    When using Windows, have you ever told "Ehi... do your business?"
    Linux user #396597 (http://counter.li.org)

  3. #3
    -->
    Excellent idea! Thanks

$spacer_open
$spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •