[tigervnc/f13/master] Press fake modifiers correctly (#633931).
Adam Tkac
atkac at fedoraproject.org
Thu Sep 16 13:44:18 UTC 2010
commit f099563885a19181156d946d9d930e309a7f28da
Author: Adam Tkac <atkac at redhat.com>
Date: Thu Sep 16 15:32:14 2010 +0200
Press fake modifiers correctly (#633931).
Conflicts:
tigervnc.spec
Signed-off-by: Adam Tkac <atkac at redhat.com>
tigervnc.spec | 7 +++-
tigervnc11-rh633931.patch | 87 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 1 deletions(-)
---
diff --git a/tigervnc.spec b/tigervnc.spec
index 0fba174..d4d94f1 100644
--- a/tigervnc.spec
+++ b/tigervnc.spec
@@ -2,7 +2,7 @@
Name: tigervnc
Version: 1.0.90
-Release: 0.13.%{snap}%{?dist}
+Release: 0.14.%{snap}%{?dist}
Summary: A TigerVNC remote display system
Group: User Interface/Desktops
@@ -47,6 +47,7 @@ Patch12: tigervnc11-rh600070.patch
Patch13: tigervnc11-rh597172.patch
Patch14: tigervnc11-rh611677.patch
Patch15: tigervnc11-rh611677-xorg.patch
+Patch16: tigervnc11-rh633931.patch
%description
Virtual Network Computing (VNC) is a remote display system which
@@ -105,6 +106,7 @@ to access the desktop on your machine.
%patch12 -p1 -b .rh600070
%patch13 -p1 -b .rh597172
%patch14 -p1 -b .rh611677
+%patch16 -p1 -b .rh633931
cp -r /usr/share/xorg-x11-server-source/* unix/xserver
pushd unix/xserver
@@ -253,6 +255,9 @@ fi
%endif
%changelog
+* Thu Sep 16 2010 Adam Tkac <atkac redhat com> 1.0.90-0.14.20100420svn4030
+- press fake modifiers correctly (#633931)
+
* Wed Aug 25 2010 Adam Tkac <atkac redhat com> 1.0.90-0.13.20100420svn4030
- Xvnc: handle situations when no modifiers exist well (#611677)
diff --git a/tigervnc11-rh633931.patch b/tigervnc11-rh633931.patch
new file mode 100644
index 0000000..71797d5
--- /dev/null
+++ b/tigervnc11-rh633931.patch
@@ -0,0 +1,87 @@
+diff -up tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc.rh633931 tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc
+--- tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc.rh633931 2010-09-16 11:29:33.670000097 +0200
++++ tigervnc-1.0.90-20100813svn4123/unix/xserver/hw/vnc/Input.cc 2010-09-16 12:59:31.530002411 +0200
+@@ -271,6 +271,19 @@ void InputDevice::initInputDevice(void)
+ #endif
+ }
+
++static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char *msg)
++{
++ int action;
++ unsigned int n;
++
++ if (msg != NULL)
++ vlog.debug("%s %d %s", msg, kc, down ? "down" : "up");
++
++ action = down ? KeyPress : KeyRelease;
++ n = GetKeyboardEvents(eventq, dev, action, kc);
++ enqueueEvents(dev, n);
++}
++
+ #define IS_PRESSED(keyc, keycode) \
+ ((keyc)->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
+
+@@ -294,7 +307,7 @@ public:
+ ~ModifierState()
+ {
+ for (int i = 0; i < nKeys; i++)
+- generateXKeyEvent(keys[i], !pressed);
++ pressKey(dev, keys[i], !pressed, "fake keycode");
+ delete [] keys;
+ }
+
+@@ -389,22 +402,10 @@ private:
+ if (keycode) {
+ if (!keys) keys = new int[maxKeysPerMod];
+ keys[nKeys++] = keycode;
+- generateXKeyEvent(keycode, down);
++ pressKey(dev, keycode, down, "fake keycode");
+ }
+ }
+
+- void generateXKeyEvent(int keycode, bool down)
+- {
+- int n, action;
+-
+- action = down ? KeyPress : KeyRelease;
+- n = GetKeyboardEvents(eventq, dev, action, keycode);
+- enqueueEvents(dev, n);
+-
+- vlog.debug("fake keycode %d %s", keycode,
+- down ? "down" : "up");
+- }
+-
+ int modIndex;
+ int nKeys;
+ int *keys;
+@@ -503,8 +504,8 @@ void InputDevice::keyEvent(rdr::U32 keys
+ KeyCode minKeyCode, maxKeyCode;
+ KeyCode *modmap = NULL;
+ int mapWidth;
+- unsigned int i, n;
+- int j, k, action, state, maxKeysPerMod;
++ unsigned int i;
++ int j, k, state, maxKeysPerMod;
+
+ initInputDevice();
+
+@@ -691,12 +692,14 @@ ModeSwitchFound:
+ modeSwitch.release();
+ }
+ }
+- }
++ /*
++ * Ensure ModifierState objects are not destroyed before
++ * pressKey call, otherwise fake modifier keypress can be lost.
++ */
++ pressKey(keyboardDev, kc, down, "keycode");
++ } else
++ pressKey(keyboardDev, kc, down, "keycode");
+
+- vlog.debug("keycode %d %s", kc, down ? "down" : "up");
+- action = down ? KeyPress : KeyRelease;
+- n = GetKeyboardEvents(eventq, keyboardDev, action, kc);
+- enqueueEvents(keyboardDev, n);
+
+ FREE_MAPS;
+
More information about the scm-commits
mailing list