From 2df2a07b36190df7ec374dda1a8ed647e4cf80e4 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 15 Sep 2017 15:34:24 +0200 Subject: [PATCH] Handle XKB groups properly in x0vncserver --- unix/x0vncserver/x0vncserver.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index a60a7277..f4dd6f99 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -373,8 +373,11 @@ public: keycode <= xkb->max_key_code; keycode++) { KeySym cursym; - unsigned int mods; - XkbTranslateKeyCode(xkb, keycode, state.compat_state, &mods, &cursym); + unsigned int mods, out_mods; + // XkbStateFieldFromRec() doesn't work properly because + // state.lookup_mods isn't properly updated, so we do this manually + mods = XkbBuildCoreState(XkbStateMods(&state), state.group); + XkbTranslateKeyCode(xkb, keycode, mods, &out_mods, &cursym); if (cursym == keysym) break; } -- 2.39.5