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 commit4d5df14f2c
) (cherry picked from commit91077bfc50
)
This commit is contained in:
parent
a53172827c
commit
83e76fb3f7
@ -262,7 +262,8 @@ typedef struct
|
||||
oldprocs->unwrapProc = device->unwrapProc; \
|
||||
device->unwrapProc = unwrapproc;
|
||||
|
||||
#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
|
||||
#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs, backupproc) \
|
||||
backupproc = device->public.processInputProc; \
|
||||
device->public.processInputProc = oldprocs->processInputProc; \
|
||||
device->public.realInputProc = oldprocs->realInputProc; \
|
||||
device->unwrapProc = oldprocs->unwrapProc;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user