New version of xfixes with client side cursor support

Keith Packard keithp at
Tue Feb 20 19:59:15 PST 2007

On Tue, 2007-02-20 at 10:50 +0100, David Reveman wrote:

> I think we look at this in two different ways. The request name should
> probably have been NameCursorImagePixmap as it was never intended to
> name the pixmap for a specific cursor but rather the image currently
> used as cursor for the core pointer so there's no right or wrong cursor,
> it's just that image. But I understand that this is not good enough.

When you're going to paint the cursor at a specific location, there is a
right and wrong cursor; you need to get the cursor for the target
location (in both space and time), not some other cursor. I think we
need stable cursor names here, or at least stable for some length of
time. One option is to have the server allocate pixmap IDs itself and
send those to clients instead of 'serial numbers'. 

The only issue there is deallocating them, but I suggest that we can
free them when the client to which they were sent was closed down (or
when it explicitly freed them itself). Of course, the server would
re-use the same pixmap ID when that was easy, so the client wouldn't
have to constantly free pixmaps.

For ARGB cursors, this just means having another name for the existing
cursor image, which is nearly free, taking only a resource manager
bucket to point at the pixmap. For two-color cursors, we have to create
an ARGB cursor image and attach that to the resource.

> However, having it actually name a specific cursor instead should be
> good enough. Even if it's just naming the current cursor as the cursor
> serial could be used to make sure that we're not drawing the wrong
> cursor at the wrong spot.

One of the goals of a composited desktop is that we always present a
'correct' image, containing snapshots of every application in a
consistent state and with a correct cursor displayed in the right

For performance reasons, we don't ever want a round-trip, so we need to
find mechanisms (like Composite) which make the whole redisplay possible
without needing data in the client.

>     image = XFixesGetCursorImage (dpy);

If you're getting the image, you've just done a round trip, and you
might as well just follow this with XCreatePixmap and XPutImage, it's
the same performance as having the server copy the data itself with a
new request.

> I don't think there's any way to know when a cursor serial no longer
> exist but simply just keeping the last 20 or so used cursors bound
> should be good enough.

We could tell the client when a cursor is no longer interesting, and it
could free the appropriate pixmap at that point.

keith.packard at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the xorg mailing list