Path: utzoo!attcan!uunet!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: Hiding the cursor Message-ID: <9103021827.AA07122@lightning.McRCIM.McGill.EDU> Date: 2 Mar 91 18:27:21 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 32 > I thought it should be pretty simple, but I can't figure out how to > hide the cursor for a window. My application happens to be letting > the user adjust a sizing box, and I don't want the cursor visible, > since it is the visible box that is important to the user and not the > location of the pointer. [...] I thought of defining my own Pixmap > cursor with colors that wouldn't show up, but given that the pointer > will move over various background colors in the window I didn't see > how that could work. What you do is use the mask pixmap to define a cursor with no pixels visible. You could, for example, create a 1x1 bitmap, set its only pixel to 0, and use it as both the source and mask arguments to XCreatePixmapCursor. (Since neither the foreground nor the background color will ever be displayed, the color arguments don't matter much. If your server is stupid, you may have to pick colors that already exist somewhere on the screen to avoid color trouble, though I don't know of any servers that are that dumb.) > Is there any way to tell X NOT to display a cursor at the pointer > location for a particular window? No, though as I said you can have it display a cursor image containing no pixels, which amounts to the same thing visually. And yes, I have tried this. I have at least two different programs using the technique, and it works fine for me. (I am using the MIT server, though it should work OK on any server.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu