Shifted Tab is a generic VNC problem and not specific to just
Core keyboard. Move handling of it to the central code.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5082 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc
index 6fc007b..f1f8e11 100644
--- a/unix/xserver/hw/vnc/Input.cc
+++ b/unix/xserver/hw/vnc/Input.cc
@@ -511,6 +511,22 @@
 	}
 
 	/*
+	 * "Shifted Tab" is a bit of a mess. Some systems have varying,
+	 * special keysyms for this symbol. VNC mandates that clients
+	 * should always send the plain XK_Tab keysym and the server
+	 * should deduce the meaning based on current Shift state.
+	 * To comply with this, we will find the keycode that sends
+	 * XK_Tab, and make sure that Shift isn't cleared. This can
+	 * possibly result in a different keysym than XK_Tab, but that
+	 * is the desired behaviour.
+	 *
+	 * Note: We never get ISO_Left_Tab here because it's already
+	 *       been translated in VNCSConnectionST.
+	 */
+	if (keysym == XK_Tab && (state & ShiftMask))
+		new_state |= ShiftMask;
+
+	/*
 	 * We need a bigger state change than just shift,
 	 * so we need to know what the mask is for level 3 shifts.
 	 */
diff --git a/unix/xserver/hw/vnc/InputCore.cc b/unix/xserver/hw/vnc/InputCore.cc
index 0fc4fe1..de7653e 100644
--- a/unix/xserver/hw/vnc/InputCore.cc
+++ b/unix/xserver/hw/vnc/InputCore.cc
@@ -441,22 +441,6 @@
 				if (j & 0x2)
 					*new_state |= mask;
 
-				/*
-				 * Sort out the "shifted Tab" mess.  If
-				 * we are sent a shifted Tab, generate
-				 * a local shifted Tab regardless of
-				 * what the "shifted Tab" keysym is on
-				 * the local keyboard (it might be Tab,
-				 * ISO_Left_Tab or HP's private BackTab
-				 * keysym, and quite possibly some
-				 * others too). We never get
-				 * ISO_Left_Tab here because it's
-				 * already been translated in
-				 * VNCSConnectionST.
-				 */
-				if (keysym == XK_Tab && (state & ShiftMask))
-					*new_state |= ShiftMask;
-
 				return i;
 			}
 		}