Relax the requirements on addKeysym() so that it can add new
entries that still require modifying the current modifier state.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5104 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc
index f1f8e11..5f96f38 100644
--- a/unix/xserver/hw/vnc/Input.cc
+++ b/unix/xserver/hw/vnc/Input.cc
@@ -507,7 +507,16 @@
 		vlog.info("Added unknown keysym 0x%x to keycode %d",
 			  keysym, keycode);
 
-		new_state = state;
+		/*
+		 * The state given to addKeysym() is just a hint and
+		 * the actual result might still require some state
+		 * changes.
+		 */
+		keycode = keysymToKeycode(keysym, state, &new_state);
+		if (keycode == 0) {
+			vlog.error("Newly added keysym 0x%x cannot be generated", keysym);
+			return;
+		}
 	}
 
 	/*