[PATCH] Xi: don't copy the modifier key count when copying device classes (#25480)

Daniel Stone daniel at fooishbar.org
Thu Jun 10 04:08:17 PDT 2010


On Thu, Jun 10, 2010 at 12:21:36PM +1000, Peter Hutterer wrote:
> The modifier key count is maintained by the XKB layer and
> increased/decreased for all modifiers that set state.
> 
> Test case, MD/SD modifier key count in comment:
> 1. keyboard 1: press and hold Shift_L    # SD:1     MD:1
> 2. keyboard 2: press and release Shift_L # SD:1,0   MD:1,0
> <class copy happens>                     # SD:1     MD:1
> 3. keyboard 1: release Shift_L           # SD:0     MD:1
> 4. keyboard 1: press and release Shift_L # SD:1,0   MD:2,1
> 
> The modifier is now logically down on the MD but not on keyboard 1 or
> keyboard 2.
> 
> XKB is layered in before the DIX, it increases/decreases the modifier key
> count accordingly. In the above example, during (2), the MD gets the key
> release and thus clears the modifier bit. (3) doesn't forward the release to
> the MD because it is already cleared. The copy of modifierKeysDown when the
> lastSlave changes however increases the counter for the held key. On (4),
> the press and release are both forwarded to the MD, causing a offset by 1
> and thus do not clear the logical modifier state.
> 
> X.Org Bug 25480 <http://bugs.freedesktop.org/show_bug.cgi?id=25480>
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Makes sense to me.  I'm not quite caffeinated enough to say if this is
authoritively correct, but it's certainly less incorrect than the
current behaviour.

Acked-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100610/52980a83/attachment.pgp>


More information about the xorg-devel mailing list