[RFC] Device hierarchy for MPX

Daniel Stone daniel at fooishbar.org
Mon Sep 17 07:28:50 PDT 2007


On Mon, Sep 17, 2007 at 10:28:00PM +0930, Peter Hutterer wrote:
> If we make this hierarchy explicit, we get the notion of master and
> slave devices [2].
> A master device (MD) is a virtual device added by the X server
> internally. It is not connected to a physical device, but has a sprite
> and a focus. Multiple master devices means multiple pointers/foci. MDs
> cannot be attached to other master devices. SendCoreEvents is implicit
> for MDs.

FWIW, this bears a reasonably close relation to what we have already
with the virtual core devices.  Any operation on a control group (grab,
set keymap, whatever) explodes and acts on all those devices.

> ===== Merged states =====
> The merged state from the MD follows effectively the same rules as the
> current behaviour of the core devices. E.g. if mouse1 and mouse2 press
> button 1 and 2 respectively, the MD has buttons 1 & 2 set.
> 
> Button remapping takes in affect _before_ the MD sets state. If SD swaps
> buttons 1 and 2, pressing physical button 2 on the SD causes a button 1
> press on the MD.
> 
> [Daniel, this should work for keyboards as well, right?]

This should be fine for keyboards, with the slightly odd semantics that
holding down Ctrl on one keyboard and pressing Q on another will quit
your app.  As I explained, sending both the individual and merged state
in the event will 'solve' this, but it's a question if these are the
semantics we want or not.

> The MD thus takes on the identity of the currently active device. So
> after the mouse moves, the MD has 2 relative valuators. If the 3D device
> moves, the MD changes classes and now has 3 absolute valuators. Before
> the event is sent, a DeviceStateChangedNotify is sent to inform the
> client. The client has to be able to handle the different coordinate
> systems. Oh how much fun client-side programming will be in the future.

Again, we can just send the valuator params in the events, to let them
adjust without sending still more events.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070917/03ef85c9/attachment.pgp>


More information about the xorg mailing list