MPX updated

Peter Hutterer mailinglists at
Sun Dec 10 17:09:37 PST 2006

On 08/12/2006, at 22:31 , Daniel Stone wrote:
> Firstly, the number of #ifdef MPXes is kind of scary.  If it's rather
> useful -- and requires breaking core APIs anyway -- we can just  
> merge it
> into the new Xi, which I've been planning for a while.  This will  
> reduce
> the number of new events, makes the semantics slightly less  
> complicated,
> and Xi is now required, so you get a grand total of zero ifdefs.   
> Sound
> decent?

sounds good.
Merging into Xi will also require additions of the Xi protocol.  
There's a few things Xi can't do now (XWarpDevicePointer or  
XQueryDevicePointer for example).
There is also something else: The core pointer does not send Xi  
events. In a true multipointer setup, the core pointer should not be  
different to the other devices. My plans were to let the core pointer  
send MPX events as well (this would only be a few lines of code to  
add). We need to agree on a solution here.

> One thing that might be interesting to chase up, as an internal
> implementation detail, is having a struct PointerRec or so, and then
> pointer devices can just have a pointer to the relevant PointerRec,
> which can either be their own (for MPX devices), or the core pointer.
> This also allows you to aggregate multiple extended devices into one
> pointer, should you so wish -- pathological though that seems.  This
> would, in theory, also get rid of the mpsprites global.

I'll push the SpritePtr into the DeviceIntRec and set it to the  
correct memory when the device is initiated. That way I should get  
rid of a lot of changes in most functions in dix. The sprite is  
always pDev->sprite, and most of the functions in dix don't need any  
changes except the additional parameter.

> POINTER_MULTI seems kind of redundant: can we not just infer this from
> the device?
true, that's a leftover from the first changes. fixed in my git repo.

> Also:
> --- a/mi/mipointer.c
> +++ b/mi/mipointer.c
> @@ -1,5 +1,5 @@
>  /*
> - * mipointer.c
> + * miPointer->c
>   */
> :)

hehe. %s/mipointer.c/miPointer->c/g does that. didn't notice. :)

> Some of your '#if !defined MPX blah #else otherblah #endif' constructs
> seem a bit backwards, too.

should go away when I remove the defines.

There is also a way how to optimise the sprite rendering stuff but it  
requires a major API break (again).
At the moment, there is a global array[MAX_DEVICES] with all the  
information in both mipointer and misprite.
This is a bit of a waste. In the future, I'd like to push both the  
miCursorInfoPtr and the miPointerRec into the devPrivates of the  
Unfortunately, at the time when miPointer/miSpriteInitialize is  
called, the devices do not exist yet. We would need to get a new  
PostInitializeDevices() or something into the main. In that case, all  
graphics drivers would need to update too,  to route it through miDC,  
misprite up to miPointer.
not sure whether I want to do that yet.


Multi-Pointer X Server

More information about the xorg mailing list