From c4f0e38be807d6f805c757e1219013f6933ff5d3 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Jan 14 2011 13:39:21 +0000 Subject: Improve patch for keyboard issues. Signed-off-by: Adam Tkac --- diff --git a/tigervnc.spec b/tigervnc.spec index 0b279d6..d999b1b 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -2,7 +2,7 @@ Name: tigervnc Version: 1.0.90 -Release: 0.28.%{snap}%{?dist} +Release: 0.29.%{snap}%{?dist} Summary: A TigerVNC remote display system Group: User Interface/Desktops @@ -303,6 +303,9 @@ fi %doc LICENCE.TXT %changelog +* Fri Jan 14 2011 Adam Tkac 1.0.90-0.29.20101208svn4225 +- improve patch for keyboard issues + * Fri Jan 14 2011 Adam Tkac 1.0.90-0.28.20101208svn4225 - attempt to fix various keyboard-related issues (key repeating etc) diff --git a/tigervnc11-rh607866.patch b/tigervnc11-rh607866.patch index 6689248..028c737 100644 --- a/tigervnc11-rh607866.patch +++ b/tigervnc11-rh607866.patch @@ -1,6 +1,6 @@ diff -up tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc ---- tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 2011-01-14 13:11:34.133210830 +0100 -+++ tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc 2011-01-14 13:14:56.744795691 +0100 +--- tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 2010-12-08 17:31:39.000000000 +0100 ++++ tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc 2011-01-14 14:28:20.920142574 +0100 @@ -520,6 +520,49 @@ static struct altKeysym_t { #define FREE_MAPS #endif @@ -80,7 +80,7 @@ diff -up tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 t /* find which modifier Mode_switch is on. */ int modeSwitchMapIndex = 0; for (i = 3; i < 8; i++) { -@@ -603,7 +661,36 @@ void InputDevice::keyEvent(rdr::U32 keys +@@ -603,7 +661,26 @@ void InputDevice::keyEvent(rdr::U32 keys } ModeSwitchFound: @@ -101,23 +101,13 @@ diff -up tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 t + } + + goto press; -+ } else { -+ /* -+ * If you would like to press a key which is already pressed then -+ * viewer didn't send the "release" event. In this case release it -+ * before the press. -+ */ -+ if (IS_PRESSED(keyc, kc) && down) { -+ vlog.debug("KeyRelease for %d wasn't sent, releasing", kc); -+ pressKey(keyboardDev, kc, KeyRelease, "fixing keycode"); -+ } + } +#endif + if (maxKeysPerMod != 0) { if ((state & (1 << ShiftMapIndex)) != 0) col |= 1; -@@ -612,7 +699,7 @@ ModeSwitchFound: +@@ -612,7 +689,7 @@ ModeSwitchFound: col |= 2; } @@ -126,7 +116,7 @@ diff -up tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 t /* * Sort out the "shifted Tab" mess. If we are sent a shifted Tab, -@@ -689,6 +776,7 @@ ModeSwitchFound: +@@ -689,6 +766,7 @@ ModeSwitchFound: return; } @@ -134,10 +124,20 @@ diff -up tigervnc-1.0.90-20101208svn4225/unix/xserver/hw/vnc/Input.cc.rh607866 t /* * See if it's a modifier key. If so, then don't do any auto-repeat, * because the X server will translate each press into a release -@@ -703,6 +791,7 @@ ModeSwitchFound: +@@ -703,6 +781,17 @@ ModeSwitchFound: } } } ++#else ++ /* ++ * If you would like to press a key which is already pressed then ++ * viewer didn't send the "release" event. In this case release it ++ * before the press. ++ */ ++ if (IS_PRESSED(keyc, kc) && down) { ++ vlog.debug("KeyRelease for %d wasn't sent, releasing", kc); ++ pressKey(keyboardDev, kc, false, "fixing keycode"); ++ } +#endif if (maxKeysPerMod != 0) {