How do I hide the mouse pointer under X11? I would like to use the built in libraries in order to do this and not something like SDL (SDL_ShowCursor(0)) or glut (glutSetCursor(GLUT_CURSOR_NONE)). Also, the mouse pointer should be hidden no matter the pointer location, not just in its own window.
Join Stack Overflow to learn, share knowledge, and build your career.
|
You can create and set an invisible cursor theme. This trick is used by maemo, because it's rather pointless to have a cursor on a touchscreen device. Sadly, the ability to change the global cursor theme at runtime is not uniform across X11 applications and toolkits. You can change the server resource At least changing the cursor for your own application is as easy as XDefineCursor, and if you do that on the root window, some applications might follow along. |
|||||||||||||||||
|
|
Here's a description how
|
|||||
|
|
I'd rather use simpler method:
You almost do not see cursor, still it is available. To disable mouse:
Or disable mouse module permanently somewhere in /etc/. See your distribution manual. |
|||||
|
an alternative to unclutterUnclutter didn't work for me, as it doesn't play well with hardware accelerated surfaces (such as for example those produced by intels' VA-API when decoding video). So I found a program that hid the mouse pointer in a less roundabout way, hhp, and rewrote it in C with minimal dependencies, the result is hhpc. I did this to obviate the need to have haskell to compile it and because hhp sometimes stopped hiding the mouse pointer. hhpc, relies only on |
|||||
|
|
I ended up using XDefineCursor like ephemient mentioned. The control application changed the default root window cursor and the other applications (which are under my control) inherited it. Code specifics look like:
In order to hide the cursor and then after I'm done
To restore X's left handed cursor (Since it's the root window and I don't want it to stay invisible. I'm not sure, but I might also be able to use
|
|||||
|
|
There is a
|
|||
|
|
|
Use xbanish! It "banish the mouse cursor when typing"! Start it with
and enjoy! |
|||||
|
|
All right! I guess this post may be getting a little bit old, but if what I've found can help some of us, I definitely have to post it here ;) I found myself a clean and simple solution that works fine, without using "xcb" ( for what I tried to achieve, it was a litte over-engineering (..) So: All you need is the "xsetroot" command, with appropriate arguments/params: -> to hide the mouse cursor, you need an extra little file (I called mine "blnk_ptr.xbm") the content of this file:
Then, we can use the two following commands: -> to hide the mouse pointer cursor:
-> to show the mouse pointer cursor again:
( you can use a mouse pointer cursor other than "left_ptr", but this one seems to be widely available across *nix systems (..) Btw-> I don't know yet how to get the name of the pointer currently used by the system using xsetroot --> I guess I'll [as usual] digg that too, but I'd be happy to have someone who knows the how-to giving me the answer ( It'd be nice ;) ) Enjoy ? ;p |
||||
|
|
|
This is my solution. It places the cursor where you can't see it (in my case, in the bottom-left corner) - then, it disables the mouse, so you can't move it. Note You could parse data from
|
|||||
|