summaryrefslogtreecommitdiff
path: root/xkb/xkbAccessX.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 16:22:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 16:37:39 +1000
commitb40289c8766c5e7543b7288009b4d965f57c04ce (patch)
tree0d63c891bdfcfff8905871ac170b05b10b29e073 /xkb/xkbAccessX.c
parent38df8351b36195070232b42a6d3369a9a08df8df (diff)
xkb: allow pointer events to pass through for floating SDs without a key class.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb/xkbAccessX.c')
-rw-r--r--xkb/xkbAccessX.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 88d5d9087..f0f757818 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -687,21 +687,28 @@ void
ProcessPointerEvent( InternalEvent *ev,
DeviceIntPtr mouse)
{
-DeviceIntPtr dev = GetPairedDevice(mouse);
-XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
+DeviceIntPtr dev;
+XkbSrvInfoPtr xkbi = NULL;
unsigned changed = 0;
ProcessInputProc backupproc;
xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
DeviceEvent *event = (DeviceEvent*)ev;
- xkbi->shiftKeyCount = 0;
- xkbi->lastPtrEventTime= event->time;
+ dev = (IsMaster(mouse) || mouse->u.master) ? GetMaster(mouse, MASTER_KEYBOARD) : mouse;
+
+ if (dev && dev->key)
+ {
+ xkbi = dev->key->xkbInfo;
+ xkbi->shiftKeyCount = 0;
+ xkbi->lastPtrEventTime= event->time;
+ }
if (event->type == ET_ButtonPress) {
changed |= XkbPointerButtonMask;
}
else if (event->type == ET_ButtonRelease) {
- xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7));
+ if (xkbi)
+ xkbi->lockedPtrButtons&= ~(1 << (event->detail.key & 0x7));
changed |= XkbPointerButtonMask;
}
@@ -726,6 +733,9 @@ DeviceEvent *event = (DeviceEvent*)ev;
COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr,
backupproc, xkbUnwrapProc);
+ if (!xkbi)
+ return;
+
xkbi->state.ptr_buttons = (mouse->button) ? mouse->button->state : 0;
/* clear any latched modifiers */