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.
This commit is contained in:
Camilla Löwy 2020-05-19 17:44:59 +02:00
parent 844bc8031c
commit 0c403c8ca6

View File

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