]> source.dussan.org Git - tigervnc.git/commitdiff
XkbTranslateKeyCode() is not implemented according to
authorPierre Ossman <ossman@cendio.se>
Thu, 23 May 2013 11:42:41 +0000 (11:42 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 23 May 2013 11:42:41 +0000 (11:42 +0000)
specification in any system I can find, so change our code
to follow reality rather than specification.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5106 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/InputXKB.cc

index f3211bf7f98da515b33227db564d45a76608e33b..04e377c72b33055204fdeba644eb0d70b7145e85 100644 (file)
@@ -414,7 +414,14 @@ KeyCode InputDevice::keysymToKeycode(KeySym keysym, unsigned state,
                if (ks == NoSymbol)
                        continue;
 
-               if (state_out & state & LockMask)
+               /*
+                * Despite every known piece of documentation on
+                * XkbTranslateKeyCode() stating that mods_rtrn returns
+                * the unconsumed modifiers, in reality it always
+                * returns the _potentially consumed_ modifiers.
+                */
+               state_out = state & ~state_out;
+               if (state_out & LockMask)
                        XkbConvertCase(ks, &dummy, &ks);
 
                if (ks == keysym)