XCreatePixmapCursor stats a lot of files...
bjourne at gmail.com
Mon Oct 1 15:27:20 PDT 2007
On 10/1/07, Glynn Clements <glynn at gclements.plus.com> 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
> 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.
I tried a very simple patch to fix it. No bad side-effects detected in
the programs I tried it in. Program starts 150+ ms faster. See
attachment. Oh, and what is that USE_DYNAMIC_XCURSOR thing about?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 934 bytes
Desc: not available
More information about the xorg