XCreatePixmapCursor stats a lot of files...

Glynn Clements glynn at gclements.plus.com
Tue Oct 2 09:36:48 PDT 2007


Lubos Lunak wrote:

> > > I'm sending two Pixmaps, one for the bitmap and another
> > > for the mask to XCreatePixmapCursor(). This data completely specifies
> > > the appearance of the cursor. How could any theming be necessary? The
> > > man page doesn't mention theming.
> >
> > Theming isn't necessary. If you tell X to use a specific pixmap pair
> > as the cursor, it should do exactly that.
> >
> > If someone is trying to implement "automagic" theming by intercepting
> > XCreatePixmapCursor(), they urgently need to be shot^H^H^H^H
> > re-educated.
> >
> > If you want themed cursors, use functions which provide themed
> > cursors. If you call XCreatePixmapCursor(), using anything other than
> > the specified pixmap/mask is a bug, period.
> 
>  No, it is a feature AFAIK.

No, it's a bug, insofar as it contradicts the documentation of
XCreatePixmapCursor() as well as existing behaviour. Also, it appears
that there is no way to override it and *force* Xlib to do what it's
told.

> XCreatePixmapCursor() is from Xlib, i.e. it's been 
> there since ever, but libXcusor is much younger, meaning not everybody uses 
> it. Or that was at least the case when it was new, definitely. Back then 
> everybody used their own cursors since the standard X cursors set lacks many 
> basic ones. And when Xcursor and themable cursors came, standard X cursor 
> could be themed, but the hand-made ones couldn't

More importantly, the hand-made ones *shouldn't* be themed; whether or
not they "can" be doesn't come into it.

> -> here comes the automagic theming to save the day.

Oh, I'm well aware of the motivation behind it. But unlike whoever was
responsible, I'm also well aware of just how stupid the idea is.

If you want themed cursors, modify the application to use themed
cursors; don't add ill-conceived hacks to Xlib.

The fact that this kind of stuff is making it into Xlib suggests a
deficiency in the QA process.

>  The fact that the cursor theming is pretty inefficient is a different matter 
> though :(.

The inefficiency isn't the problem. The fact that it's happening at
all is the problem. If the client tells Xlib to use a specific pixmap
and mask as the cursor, Xlib should damn well do what it's told, not
ignore the client and use some other cursor.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list