X11: Fix XKB group event depending on state query

This fixes XKB group change events not being enabled if the initial
XKB keyboard state query fails.

(cherry picked from commit 0c403c8ca6)
This commit is contained in:
Camilla Löwy 2020-05-19 17:44:59 +02:00
parent d0c0997528
commit 117f7694b2

View File

@ -769,10 +769,9 @@ static GLFWbool initExtensions(void)
_glfw.x11.xkb.group = 0;
XkbStateRec state;
if (XkbGetState(_glfw.x11.display, XkbUseCoreKbd, &state) == Success)
{
XkbSelectEventDetails(_glfw.x11.display, XkbUseCoreKbd, XkbStateNotify, XkbAllStateComponentsMask, XkbGroupStateMask);
_glfw.x11.xkb.group = (unsigned int)state.group;
}
XkbSelectEventDetails(_glfw.x11.display, XkbUseCoreKbd, XkbStateNotify, XkbAllStateComponentsMask, XkbGroupStateMask);
}
#if defined(__CYGWIN__)