xserver/include
Peter Hutterer 651c36e95e xkb: post-fix PointerKeys button events with a DeviceChangedEvent.
commit 1432785839
    xkb: release XTEST pointer buttons on physical releases. (#28808)
revealed a bug with the XTEST/PointerKeys interaction.

Events resulting from PointerKeys are injected into the event processing
stream, not appended to the event queue. The events generated for the fake
button press include a DeviceChangedEvent (DCE), a raw button event and the
button event itself. The DCE causes the master to switch classes to the
attached XTEST pointer device.

Once the fake button is processed, normal event processing continues with
events in the EQ. The master still contains the XTEST classes, causing some
events to be dropped if e.g. the number of valuators of the event in the
queue exceeds the XTEST device's number of valuators.

Example: the EQ contains the following events, processed one-by-one, left to
right.

[DCE (dev)][Btn down][Btn up][Motion][Motion][...]
                  ^ XkbFakeDeviceButton injects [DCE (XTEST)][Btn up]

Thus the event sequence processed looks like this:

[DCE (dev)][Btn down][Btn up][DCE (XTEST)][Btn up][Motion][Motion][...]

The first DCE causes the master to switch to the device. The button up event
injects a DCE to the XTEST device, causing the following Motion events to be
processed with the master still being on XTEST classes.

This patch post-fixes the injected event sequence with a DCE to restore the
classes of the original slave device, resulting in an event sequence like
this:
[DCE (dev)][Btn down][Btn up][DCE (XTEST)][Btn up][DCE (dev)][Motion][Motion]

Note that this is a simplified description. The event sequence injected by
the PointerKeys code is injected for the master device only and the matching
slave device that caused the injection has already finished processing on
the slave. Furthermore, the injection happens as part of the the XKB layer,
before the unwrapping of the processInputProc takes us into the DIX where
the DCE is actually handled.

Bug reproducible with a device that reports more than 2 valuators. Simply
cause button releases on the device and wait for a "too many valuators"
warning message.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-08-13 11:07:13 +10:00
..
.gitignore
Makefile.am Move callback definitions to their own file 2010-04-30 13:04:44 -07:00
XIstubs.h
bstore.h
bstorestr.h
callback.h Move callback definitions to their own file 2010-04-30 13:04:44 -07:00
closestr.h fonts: Fix refcounting for asynchronous font operations (#3040) 2010-08-09 21:31:41 -07:00
closure.h
colormap.h Quit using clientErrorValue in dix/colormap.c. 2010-05-13 17:14:07 -07:00
colormapst.h
cursor.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
cursorstr.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
dix-config-apple-verbatim.h
dix-config.h.in xfree86: Add MatchOS InputClass entry for operating system matching 2010-06-10 14:36:36 +10:00
dix.h Remove unnecessary parentheses around return values in functions 2010-06-10 06:42:42 -07:00
dixaccess.h
dixevents.h
dixfont.h dix: use one single function to register fpe fonts 2010-06-24 13:55:28 -07:00
dixfontstr.h
dixgrabs.h
dixstruct.h OS support: fix writeable client vs IgnoreClient behavior 2010-06-30 07:59:04 -07:00
eventconvert.h Re-enable RECORD extension. 2010-02-22 12:04:28 +10:00
events.h
eventstr.h dix: make DeviceEvent coordinates signed for Xinerama. #24986 2010-05-07 12:17:22 -07:00
exevents.h
extension.h
extinit.h
extnsionst.h Declare functions that unconditionally call FatalError as _X_NORETURN. 2010-05-22 01:00:04 -07:00
gc.h Replace dixChangeGC with calls directly to the right variant. 2010-05-13 17:14:07 -07:00
gcstruct.h Replace screen->rgf scratch GC flags with a bit in each GC. 2010-05-20 14:36:29 -07:00
globals.h Move each screen's x/y origin into ScreenRec. 2010-06-03 14:03:23 -07:00
hotplug.h
input.h xkb: post-fix PointerKeys button events with a DeviceChangedEvent. 2010-08-13 11:07:13 +10:00
inputstr.h If XTest is always required, then eliminate the XTest devPrivate 2010-06-07 19:56:47 -07:00
kdrive-config.h.in
list.h list.h: Fix list_for_each_entry_safe() 2010-06-22 12:21:51 -07:00
misc.h Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN 2010-05-13 10:03:23 -07:00
miscstruct.h
opaque.h
os.h Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN 2010-05-13 10:03:23 -07:00
pixmap.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
pixmapstr.h
privates.h Correct function name in dixRegisterPrivateKey comments 2010-08-09 21:09:56 -07:00
property.h
propertyst.h
protocol-versions.h Increase advertised RENDER protocol minor version to 11 2010-07-06 10:14:00 -04:00
ptrveloc.h Replace some input devPrivates with regular struct fields 2010-04-30 13:05:11 -07:00
region.h
regionstr.h Add REGION_ macros for source compatibility with existing drivers. 2010-06-05 19:03:22 -07:00
registry.h
resource.h Add typed resource-lookup errors for non-core resource types. 2010-05-19 12:32:48 -07:00
rgb.h
screenint.h
scrnintstr.h Change region implementation from macros to inline functions. 2010-06-05 19:03:22 -07:00
selection.h
servermd.h
site.h
swaprep.h
swapreq.h
validate.h
version-config.h.in
window.h
windowstr.h Move each screen's screensaver data into ScreenRec. 2010-06-03 14:03:22 -07:00
xkb-config.h.in
xkbfile.h
xkbrules.h
xkbsrv.h Revert "xkb: merge lockedPtrButtons state from all attached SDs." 2010-07-01 23:46:27 -04:00
xkbstr.h
xorg-config.h.in DRI2: Allow building without libdrm 2010-06-03 11:56:03 +03:00
xorg-server.h.in
xserver-properties.h dix: add 3x3 transformation matrix xinput property for multi-head handling 2010-05-28 16:49:30 +10:00
xsha1.h
xwin-config.h.in Cygwin/X: Allow the default log location to be configurable 2010-03-16 14:02:17 +00:00