Skip to content

Commit

Permalink
Hack for X11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Feb 10, 2024
1 parent 3fe1b7a commit 1b0464e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ enum mod_type {

/* Count of real modifiers */
#define MOD_REAL_MAX 13
#define MOD_REAL_MAX_X11 8

/* Ensure we can encode the modifier mask in xkb_mod_mask_t */
_Static_assert(MOD_REAL_MAX <= XKB_MAX_MODS);

/* Mask for all real modifiers */
#define MOD_REAL_MASK_ALL ((xkb_mod_mask_t) ((1u << MOD_REAL_MAX) - 1))
#define MOD_REAL_MASK_ALL_X11 ((xkb_mod_mask_t) ((1u << MOD_REAL_MAX_X11) - 1))

enum xkb_action_type {
ACTION_TYPE_NONE = 0,
Expand Down
3 changes: 2 additions & 1 deletion src/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ ModMaskText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
if (mask == 0)
return "none";

if (mask == MOD_REAL_MASK_ALL)
if (mask == MOD_REAL_MASK_ALL ||
mask == MOD_REAL_MASK_ALL_X11 /* hack for X11 compatibility */)
return "all";

xkb_mods_enumerate(i, mod, mods) {
Expand Down

0 comments on commit 1b0464e

Please sign in to comment.