diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-06-21 18:24:30 +0930 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-10-28 15:51:34 +0200 |
commit | 91077bfc50d54be37c217e377c55b6bf886a2fab (patch) | |
tree | 6c1b2c036863d098111aa708cf0c8c8363f2a38a /xkb | |
parent | 8b9481a113b56078191e2298bf590905978f6289 (diff) |
Save processInputProc before wrapping it and restore it later, instead of
using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to
process DeviceKeyEvents after the first key press.
This should be the correct fix now.
(cherry picked from commit 4d5df14f2c4a3108a8c8adfcf4766c0d1a9daad2)
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbActions.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index ef67d64e8..2c7c2cd6f 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -49,10 +49,11 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); ProcessInputProc tmp = device->public.processInputProc; + ProcessInputProc dummy; /* unused, but neede for macro */ if(xkbPrivPtr->unwrapProc) xkbPrivPtr->unwrapProc = NULL; - UNWRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr, dummy); proc(device,data); WRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr, tmp,xkbUnwrapProc); @@ -851,6 +852,7 @@ int x,y; XkbStateRec old; unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); +ProcessInputProc backupproc; /* never actually used uninitialised, but gcc isn't smart enough * to work that out. */ @@ -903,10 +905,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; if ( mask || mods ) { @@ -944,10 +946,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; if ( mask || mods ) { @@ -1140,6 +1142,7 @@ Bool pressEvent; #ifdef XINPUT Bool xiEvent; #endif +ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); @@ -1284,10 +1287,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); if (keyEvent) { realMods = keyc->modifierMap[key]; keyc->modifierMap[key] = 0; - UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr); + UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr, backupproc); dev->public.processInputProc(xE,dev,count); COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr, - ProcessKeyboardEvent,xkbUnwrapProc); + backupproc,xkbUnwrapProc); keyc->modifierMap[key] = realMods; } else CoreProcessPointerEvent(xE,dev,count); |