]> source.dussan.org Git - tigervnc.git/commitdiff
Handle XKB groups properly in x0vncserver
authorPierre Ossman <ossman@cendio.se>
Fri, 15 Sep 2017 13:34:24 +0000 (15:34 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 15 Sep 2017 13:34:24 +0000 (15:34 +0200)
unix/x0vncserver/x0vncserver.cxx

index a60a72779c5062ae3dee40e1e64a58d4c81beb3e..f4dd6f990b2e1b58050455b2ad35574e61140263 100644 (file)
@@ -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;
     }