summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xkbsrv.h6
-rw-r--r--xkb/xkbAccessX.c23
-rw-r--r--xkb/xkbActions.c4
3 files changed, 18 insertions, 15 deletions
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 956b2249b..9f1507e8e 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -927,6 +927,12 @@ extern int XkbGetEffectiveGroup(
extern void XkbMergeLockedPtrBtns(
DeviceIntPtr /* master */);
+extern void XkbFakeDeviceButton(
+ DeviceIntPtr /* dev */,
+ int /* press */,
+ int /* button */);
+
+
#include "xkbfile.h"
#include "xkbrules.h"
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 81f959677..10c38ca47 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -710,19 +710,16 @@ DeviceEvent *event = &ev->device_event;
if (xkbi) {
xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7));
- /* Merge this MD's lockedPtrButtons with the one of all
- * attached slave devices.
- * The DIX uses a merged button state for MDs, not
- * releasing buttons until the last SD has released
- * thenm. If we unconditionally clear the
- * lockedPtrButtons bit on the MD, a PointerKeys button
- * release on the SD keyboard won't generate the required fake button
- * event on the XTEST pointer, thus never processing the
- * button event in the DIX and the XTEST pointer's
- * buttons stay down - result is a stuck button.
- */
- if (IsMaster(dev))
- XkbMergeLockedPtrBtns(dev);
+ if (IsMaster(dev))
+ {
+ DeviceIntPtr source;
+ int rc;
+ rc = dixLookupDevice(&source, event->sourceid, serverClient, DixWriteAccess);
+ if (rc != Success)
+ ErrorF("[xkb] bad sourceid '%d' on button release event.\n", event->sourceid);
+ else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
+ XkbFakeDeviceButton(dev, FALSE, event->detail.key);
+ }
}
changed |= XkbPointerButtonMask;
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 49d7b3d53..96d3847b9 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -45,7 +45,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
DevPrivateKeyRec xkbDevicePrivateKeyRec;
-static void XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button);
+void XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button);
static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y);
void
@@ -1364,7 +1364,7 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y)
FreeEventList(events, GetMaximumEventsNum());
}
-static void
+void
XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button)
{
EventListPtr events;