From ac3080f0e25f11252d47797db0044661d7554e52 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Apr 2021 21:51:03 +0530 Subject: [PATCH] Fix #3446 (I hope) --- glfw/xkb_glfw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glfw/xkb_glfw.c b/glfw/xkb_glfw.c index ae9d7c9c6..552c08ca3 100644 --- a/glfw/xkb_glfw.c +++ b/glfw/xkb_glfw.c @@ -362,11 +362,11 @@ glfw_xkb_update_masks(_GLFWXKBData *xkb) { S(control, XKB_MOD_NAME_CTRL); S(shift, XKB_MOD_NAME_SHIFT); S(capsLock, XKB_MOD_NAME_CAPS); - if (!succeeded) { - S(numLock, XKB_MOD_NAME_NUM); - S(alt, XKB_MOD_NAME_ALT); - S(super, XKB_MOD_NAME_LOGO); - } +#define C(a, n) if (xkb->a##Idx == XKB_MOD_INVALID) { S(a, n); } + C(numLock, XKB_MOD_NAME_NUM); + C(alt, XKB_MOD_NAME_ALT); + C(super, XKB_MOD_NAME_LOGO); +#undef C #undef S debug("Modifier indices alt:%u super:%u hyper:%u meta:%u numlock:%u\n", xkb->altIdx, xkb->superIdx, xkb->hyperIdx, xkb->metaIdx, xkb->numLockIdx);