Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Creating cursor problem Message-ID: <9009032254.AA20096@Larry.McRCIM.McGill.EDU> Date: 3 Sep 90 22:54:51 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 39 > I'm wanting to create a 4x4 pixel cursor [...] with a hotspot at 2,2. > And cursor_bits defined as:: static char cursor_bits[] = {[...]}; > I setup a routine that has these calls: > XCreatePixmapFromBitmapData > XLookupColor > XCreatePixmapCursor > XDefineCursor > The pixmap displayed seems to be 4 high and 16(?) long, with the > first 4 pixels set and random pixels set after that. It does seem to > change from compliation to compliation. Without seeing the arguments you pass to those calls (in particular, to XCreatePixmapFromBitmapData and XCreatePixmapCursor), it's hard to do more than guess. However... I would guess you are passing None as the mask pixmap to XCreatePixmapCursor, and the cursor image pixmap is actually stored with a width of 16, and the other 12 columns are junk left over from whatever was previously using that memory. I suspect this is technically legal; the Xlib document says "The components of the cursor can be transformed arbitrarily to meet display limitations.", which sounds like a license to do anything it pleases, but I would still call this a bug. (Seems to me it should restrict the cursor to the size of the supplied pixmap!) The likliest-to-work fix that comes to mind is to use an explicit mask pixmap. Since you say you want a 4x4 cursor, create a 4x4 pixmap of depth 1 and fill it with 1s (either with XCreatePixmapFromBitmapData or with explicit calls), then pass that to XCreatePixmapCursor. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu