xen/tigervnc-long-press.patch
Charles Arnold 5c685a813a - bnc#882405 - Only one key-press event was generated while holding
a key before key-release in pv guests through xl vncviewer 
  tigervnc-long-press.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=329
2014-09-04 17:09:23 +00:00

31 lines
1.2 KiB
Diff

Index: xen-4.4.1-testing/tools/qemu-xen-dir-remote/ui/vnc.c
===================================================================
--- xen-4.4.1-testing.orig/tools/qemu-xen-dir-remote/ui/vnc.c
+++ xen-4.4.1-testing/tools/qemu-xen-dir-remote/ui/vnc.c
@@ -1651,6 +1651,25 @@ static void do_key_event(VncState *vs, i
if (down)
vs->modifiers_state[keycode] ^= 1;
break;
+ default:
+ if (qemu_console_is_graphic(NULL)) {
+ /* record key 'down' info. Some client like tigervnc
+ * will send key down repeatedly if user pressing a
+ * a key for long time. In this case, we should add
+ * additional key up event before repeated key down,
+ * so that it can display the key multiple times.
+ */
+ if (down) {
+ if (vs->modifiers_state[keycode]) {
+ /* add a key up event */
+ do_key_event(vs, 0, keycode, sym);
+ }
+ vs->modifiers_state[keycode] = 1;
+ } else {
+ vs->modifiers_state[keycode] = 0;
+ }
+ }
+ break;
}
/* Turn off the lock state sync logic if the client support the led