Commit 56de0115e6c381432b84969569accae249687d2a

Ran Benita 2014-08-09T22:41:01

x11/keymap: handle private actions Previously we treated them as NoAction(). Signed-off-by: Ran Benita <ran234@gmail.com>

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