MPX updated

Peter Hutterer mailinglists at who-t.net
Thu Dec 7 17:22:53 PST 2006


Hey guys,

I've been working on getting MPX [1] up-to-date with the current  
server for the last few weeks. (MPX is a patch against X.org to get  
multiple mouse cursors). Thanks to Daniel Stone's changes [2], MPX  
fits now snugly into the event generation.

MPX now
- is integrated rather than bolted on top
- has it's own extension protocol
- does proper mouse cursor rendering
- has a lot of still-unused stuff under the hood

This is the first set of patches I can offer for people to play with.  
It's not overly stable or mature yet. More features will be added but  
you can get a grip on what it does.


The short version:
=============================
http://wearables.unisa.edu.au/mpx/?q=downloads
http://wearables.unisa.edu.au/mpx/?q=patching
http://wearables.unisa.edu.au/mpx/?q=configuration


The long version:
=============================
I had a different approach with this version than with the first,  
initial MPX.
The previous MPX was built on two assumptions
1) I did not have a clue what the X.org code did
2) I did not want to modify the code base
Which resulted in MPX being rather bolted on and not very scaleable.  
It did prove the point though.

This time, I didn't care about  2) and well, I do have a bit of a  
clue what is going on now.

One of the main rules I tried to follow though was that the behaviour  
of X should not change if there is only one pointer. So the core  
pointer has been neither removed nor does it behave different.  
Everything in the core protocol tends to fall back on the core  
pointer, unless there is some intelligent solution to apply it to  
all. This is still work in progress.

API changes
==========
I had to break a few APIs, resulting in miPointer, miSprite and miDC  
having DeviceIntPtr arguments now. This allows for some nifty things  
(see below). Wherever no device is given, the core pointer is used.  
Big parts of dix events have device arguments now as well.

The result of this is that, although the number of changes seems very  
high, it isn't actually that bad. The actual functionality changes  
are only little, most of the benefits come from passing the devices  
around.

MPX extension
============
There is a bit of an MPX extension already. A few requests and  
events, with more to come. MPX does not change the input extension  
any more, it has it's own events (so far MPXMotionNotify,  
MPXButtonPress and MPXButtonRelease).
Currently, there is a XCB frontend for a client that wants to use MPX.

The MPX extension borrows heavily from Xi. To be more precise, it  
uses some of Xi's function and takes a piggyback
ride on the XI event delivery. Again, this keeps the number of  
changes down.

Current procol provides the following calls:
- query extension version
- list MPX devices
- get event base
- register for events
- query for a particular pointer's coordinates

more to come.

The whole client-side part is currently XCB and I intend to maintain  
it that way for the near future. Providing an XCB frontend is much  
quicker than providing an Xlib frontend.


Cursor rendering
=============
Each cursor is it's own entity now, instead of sharing with the core  
pointer's cursor. That means that as you move one mouse into a  
textfield, only this one cursor changes to a caret. The API should  
cope with commands to change/warp etc. only one cursor but the  
protocol is not there yet. There are a few glitches left.


A lot of stuff under the hood
=====================
Passing the devices around from everywhere gives us quite a few  
benefits.
The ability to query a particular pointer's position is already  
there, but some of the possibilities include grabbing only a single  
pointer, warping a certain cursor, getting pointer-specific enter/ 
leave events, etc.
So far, there is none of the floor control I had in the old MPX but  
I'll add it to the protocol ASAP. Which means a client can then  
decide which window can receive events from pointers.

Statistics
=====================
whot at hyena:~/X11R7/xserver$> git diff origin | diffstat | tail -n 1
62 files changed, 3902 insertions(+), 1134 deletions(-)


Download & patching
===========================
There's five parts to it:

http://wearables.unisa.edu/mpx/downloads/mpx-xorg-latest.patch
	to be applied with patch -p1 in xserver
	against commit f9f7d7f3be53c808abb5eaceb7a1abc55744a210

http://wearables.unisa.edu.au/mpx/downloads/mpx-proto-latest.diff
	to be applied with patch -p0 in proto/ (will create mpxproto)

http://wearables.unisa.edu.au/mpx/downloads/mpx-xcb-latest.diff
	to be applied with patch -p1 in xcb/libxcb
	against commit f486075fa093846c3f32b3e4b9624c039ea26ba4

http://wearables.unisa.edu.au/mpx/downloads/mpx-xcbproto-latest.diff
	to be applied with patch -p1 in xcb/proto
	against commit 701dec025966bd19dcd1a6ae6f277abf3f1abd16

http://wearables.unisa.edu.au/mpx/downloads/mpx-modular-latest.patch
	to be applied with patch -p1 in util/modular
	against commit 3fd2a827e19ff31f6efd73bc94724cb1fbd135f7


The last should adjust the build.sh script that you can just use it  
to rebuild the server (disable dmx and xnest though).
So far I only tried the nv driver. I don't know whether the others  
build or work.

Unfortunately, I can't provide a public git repository to clone from,  
the patches have to do until I can provide binaries. The patches  
probably only work against the commits I have merged in my git  
repository and not against later versions.
The list of compatible commits is http://wearables.unisa.edu.au/mpx/ 
downloads/commits-latest.txt
A little script to patch and build: http://wearables.unisa.edu.au/mpx/ 
downloads/mpx_patch_and_build.sh
It's a pain. I know.


Thanks to Ben Close, Daniel Stone, Jamey Sharp, and all others who  
gave me input, feedback and provided help.

Cheers,
   Peter

[1] http://wearables.unisa.edu.au/mpx/
[2] http://lists.freedesktop.org/archives/xorg/2006-October/019007.html

--
Multi-Pointer X Server
http://wearables.unisa.edu.au/mpx


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20061208/92040e99/attachment.html>


More information about the xorg mailing list