xkb: Default to one group whenever a keymap reports none

XkbInitControls() had a fallback to ensure keymaps that defined no symbols at all still resulted in one group.
Extend this to cover the case where a keymap reports symbols but no groups.

Fixes: https://github.com/XQuartz/XQuartz/issues/422
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2278>
(cherry picked from commit 8e11715024)
(cherry picked from commit c9dd5aa9e505d65036c351c78cd74c5a6fc53535)
(cherry picked from commit 712c3e7497c90a0d9ad6f863abdd2e330623887d)
This commit is contained in:
Jeremy Huddleston Sequoia 2026-08-17 01:15:52 -07:00 • committed by Enrico Weigelt
commit 88043a1944

View file

@ -479,7 +479,7 @@ XkbInitControls(DeviceIntPtr pXDev, XkbSrvInfoPtr xkbi)
if (XkbAllocControls(xkb, XkbAllControlsMask) != Success)
FatalError("Couldn't allocate keyboard controls\n");
ctrls = xkb->ctrls;
if (!(xkb->defined & XkmSymbolsMask))
if (!(xkb->defined & XkmSymbolsMask) || ctrls->num_groups == 0)
ctrls->num_groups = 1;
ctrls->groups_wrap = XkbSetGroupInfo(1, XkbWrapIntoRange, 0);
ctrls->internal.mask = 0;