x11/keymap: handle private actions

Previously we treated them as NoAction().

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2014-08-09 22:41:01 +03:00
parent ead816e515
commit 56de0115e6
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}
}