xkb: Store the action filters per device in the XkbSrvInfoRec.

Using a global array for action filters is bad. If two keyboard hit a modifier
at the same time, releaseing the first one will deactivate the filter and
thus the second keyboard can never release the modifier again.
This commit is contained in:
Peter Hutterer
2007-09-04 17:44:51 +09:30
parent cc5c926267
commit bfe6b4d2d9
2 changed files with 57 additions and 49 deletions

View File

@@ -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)