summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-06-30 08:21:04 -0700
committerKeith Packard <keithp@keithp.com>2010-06-30 08:31:51 -0700
commit6052710670953b43b4fff5d101b727163fcb1187 (patch)
treee12ec390d6a12c1b952e67565fd56e8d6c2f4c2d /include
parent28e33ae6f69f716ece5d68e63fc52557236c5f6e (diff)
xkb: merge lockedPtrButtons state from all attached SDs.
Problem: lockedPtrButtons keeps the state of the buttons locked by a PointerKeys button press. Unconditionally clearing the bits may cause stuck buttons in this sequence of events: 1. type Shift + NumLock to enable PointerKeys 2. type 0/Ins on keypad to emulate Button 1 press → button1 press event to client 3. press and release button 1 on physical mouse → button1 release event to client Button 1 on the MD is now stuck and cannot be released. Cause: XKB PointerKeys button events are posted through the XTEST pointer device. Once a press is generated, the XTEST device's button is down. The DIX merges the button state of all attached SDs, hence the MD will have a button down while the XTEST device has a button down. PointerKey button events are only generated on the master device to avoid duplicate events (see XkbFakeDeviceButton()). If the MD has the lockedPtrButtons bit cleared by a release event on a physical device, no such event is generated when a keyboard device triggers the PointerKey ButtonRelease trigger. Since the event - if generated - is posted through the XTEST pointer device, lack of a generated ButtonRelease event on the XTEST pointer device means the button is never released, resulting in the stuck button observed above. Solution: This patch merges the MD's lockedPtrButtons with the one of all attached slave devices on release events. Thus, as long as one attached keyboard has a lockedPtrButtons bit set, this bit is kept in the MD. Once a PointerKey button is released on all keyboards, the matching release event is emulated from the MD through the XTEST pointer device, thus also releasing the button in the DIX. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include')
-rw-r--r--include/xkbsrv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 5847e6395..956b2249b 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -924,6 +924,9 @@ extern int XkbGetEffectiveGroup(
XkbStatePtr /* xkbstate */,
CARD8 /* keycode */);
+extern void XkbMergeLockedPtrBtns(
+ DeviceIntPtr /* master */);
+
#include "xkbfile.h"
#include "xkbrules.h"