From 56de0115e6c381432b84969569accae249687d2a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 9 Aug 2014 22:41:01 +0300 Subject: [PATCH] x11/keymap: handle private actions Previously we treated them as NoAction(). Signed-off-by: Ran Benita --- src/x11/keymap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/x11/keymap.c b/src/x11/keymap.c index e3f989d..0e7a890 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -299,6 +299,20 @@ translate_action(union xkb_action *action, const xcb_xkb_action_t *wire) case XCB_XKB_SA_TYPE_DEVICE_VALUATOR: action->type = ACTION_TYPE_NONE; break; + + default: + if (wire->type < ACTION_TYPE_PRIVATE) { + action->type = ACTION_TYPE_NONE; + break; + } + + /* Treat high unknown actions as Private actions. */ + action->priv.type = wire->noaction.type; + STATIC_ASSERT(sizeof(action->priv.data) == 7 && + sizeof(wire->noaction.pad0) == 7, + "The private action data must be 7 bytes long!"); + memcpy(action->priv.data, wire->noaction.pad0, 7); + break; } }