XCreatePixmapCursor stats a lot of files...

Glynn Clements glynn at gclements.plus.com
Mon Oct 1 04:08:44 PDT 2007


BJörn Lindqvist wrote:

> > > And so on, for many more themes and many more directories and many
> > > more files. Why does it do this? The documentaton doesn't explain this
> > > fairly odd behaviour. Why does it try to open the exact same file 8 or
> > > more times?
> >
> > XCreatePixmapCursor calls into the X Cursor library so that image
> > cursors may be redirected to a suitable themed cursor. So, it should be
> > opening a few files, but not this many. It seems like there's a
> > performance bug here.
> 
> It is something I'm not understanding here, but this seems just
> totally wrong.

Agreed. Actually, "totally" might be an understatement.

> 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.

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



More information about the xorg mailing list