diff options
author | Thomas Jaeger <thjaeger@gmail.com> | 2008-04-01 15:27:06 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-04-01 15:32:01 +0300 |
commit | a45586da2b2377e6fd80704b3ab454ab868f20eb (patch) | |
tree | a3de097aa4ac25377ef9b0a060ebe2a3fcdb0b8e /include | |
parent | bde2890148683118eaec4140c206c5f90fb44fa0 (diff) |
XKB: Fix processInputProc wrapping
If input processing is frozen, only wrap realInputProc: don't smash
processInputProc as well. When input processing is thawed, pIP will be
rewrapped correctly.
This supersedes the previous workaround in 50e80c9.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 37b1258f0a288a79ce6a3eef3559e17a67c4dd96)
Diffstat (limited to 'include')
-rw-r--r-- | include/xkbsrv.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/xkbsrv.h b/include/xkbsrv.h index ef99e94e7..040bb936a 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -237,6 +237,14 @@ typedef struct _XkbSrvLedInfo { typedef struct { ProcessInputProc processInputProc; + /* If processInputProc is set to something different than realInputProc, + * UNWRAP and COND_WRAP will not touch processInputProc and update only + * realInputProc. This ensures that + * processInputProc == (frozen ? EnqueueEvent : realInputProc) + * + * WRAP_PROCESS_INPUT_PROC should only be called during initialization, + * since it may destroy this invariant. + */ ProcessInputProc realInputProc; DeviceUnwrapProc unwrapProc; } xkbDeviceInfoRec, *xkbDeviceInfoPtr; @@ -254,14 +262,14 @@ typedef struct device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ - if (proc != device->public.enqueueInputProc) \ - device->public.realInputProc = proc; \ + device->public.realInputProc = proc; \ oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs, backupproc) \ - backupproc = device->public.processInputProc; \ - device->public.processInputProc = oldprocs->processInputProc; \ + backupproc = device->public.realInputProc; \ + if (device->public.processInputProc == device->public.realInputProc)\ + device->public.processInputProc = oldprocs->realInputProc; \ device->public.realInputProc = oldprocs->realInputProc; \ device->unwrapProc = oldprocs->unwrapProc; |