diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2008-05-07 06:07:10 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2008-05-07 06:07:10 +0000 |
commit | 46a653fc0cb72b557fe38c502ffd5f605daa93e2 (patch) | |
tree | 80afe4db2f0c79e29013c323cb7212558abb70a9 /xserver/include | |
parent | 762a3763038f212a072029bab55c1e24bf7e85fe (diff) |
- fix an infinite loop by ensuring that realInputProc is never
overwritten with the enqueueInputProc (from upstream git)
cf. https://bugs.freedesktop.org/show_bug.cgi?id=13511
This should fix hangs people were seeing with icewm, cwm and most
probably other WM under some circumstances.
ok matthieu@
Diffstat (limited to 'xserver/include')
-rw-r--r-- | xserver/include/xkbsrv.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 5edee539b..7846ad8ef 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -126,6 +126,24 @@ typedef struct _XkbEventCause { #define _BEEP_LED_CHANGE 14 #define _BEEP_BOUNCE_REJECT 15 +struct _XkbSrvInfo; /* definition see below */ + +typedef struct _XkbFilter { + CARD16 keycode; + CARD8 what; + CARD8 active; + CARD8 filterOthers; + CARD32 priv; + XkbAction upAction; + int (*filter)( + struct _XkbSrvInfo* /* xkbi */, + struct _XkbFilter * /* filter */, + unsigned /* keycode */, + XkbAction * /* action */ + ); + struct _XkbFilter *next; +} XkbFilterRec,*XkbFilterPtr; + typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; @@ -169,6 +187,9 @@ typedef struct _XkbSrvInfo { OsTimerPtr bounceKeysTimer; OsTimerPtr repeatKeyTimer; OsTimerPtr krgTimer; + + int szFilters; + XkbFilterPtr filters; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) @@ -237,17 +258,22 @@ typedef struct device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ - device->public.realInputProc = proc; \ + if (proc != device->public.enqueueInputProc) \ + device->public.realInputProc = proc; \ 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; +extern int xkbDevicePrivateIndex; #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr) +extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer); + /***====================================================================***/ @@ -289,8 +315,9 @@ extern CARD32 xkbDebugFlags; #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) -extern int DeviceKeyPress,DeviceKeyRelease; +extern int DeviceKeyPress,DeviceKeyRelease,DeviceMotionNotify; extern int DeviceButtonPress,DeviceButtonRelease; +extern int DeviceEnterNotify,DeviceLeaveNotify; #ifdef XINPUT #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress)) |