From d232bcfcdde2435110fcce9d6027db726e57646f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 11 Jul 2019 19:06:06 +0200 Subject: [PATCH] Cleanup Related to #1528. --- src/x11_window.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index d4da7c8d..1398cb70 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1180,12 +1180,15 @@ static void processEvent(XEvent *event) } } - if (_glfw.x11.xkb.available && event->type == _glfw.x11.xkb.eventBase) + if (_glfw.x11.xkb.available) { - if (((XkbEvent *)event)->any.xkb_type == XkbStateNotify && - ((XkbEvent *)event)->state.changed & XkbGroupStateMask) + if (event->type == _glfw.x11.xkb.eventBase + XkbEventCode) { - _glfw.x11.xkb.group = ((XkbEvent *)event)->state.group; + if (((XkbEvent*) event)->any.xkb_type == XkbStateNotify && + (((XkbEvent*) event)->state.changed & XkbGroupStateMask)) + { + _glfw.x11.xkb.group = ((XkbEvent*) event)->state.group; + } } } @@ -2789,7 +2792,8 @@ const char* _glfwPlatformGetScancodeName(int scancode) if (!_glfw.x11.xkb.available) return NULL; - const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, _glfw.x11.xkb.group, 0); + const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display, + scancode, _glfw.x11.xkb.group, 0); if (keysym == NoSymbol) return NULL;