summaryrefslogtreecommitdiff
path: root/include/xkbsrv.h
diff options
context:
space:
mode:
authorThomas Jaeger <thjaeger@gmail.com>2008-04-01 15:27:06 +0300
committerDaniel Stone <daniel@fooishbar.org>2008-04-01 15:31:50 +0300
commit37b1258f0a288a79ce6a3eef3559e17a67c4dd96 (patch)
tree9712e689fc235bfdba2897fe07d9efd58c0ab992 /include/xkbsrv.h
parenta4d034941100c6ca3b7cc4e59952c2745b9306cc (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>
Diffstat (limited to 'include/xkbsrv.h')
-rw-r--r--include/xkbsrv.h16
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;