From 517441da457e40671278816b7e392cfc74c8e0e4 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jul 05 2019 22:43:31 +0000 Subject: Backport #1174 to work around RHBZ #1727388 (key press order) --- diff --git a/0001-VNC-reverse-key-order-when-sending-key-up-events.patch b/0001-VNC-reverse-key-order-when-sending-key-up-events.patch new file mode 100644 index 0000000..8e032a3 --- /dev/null +++ b/0001-VNC-reverse-key-order-when-sending-key-up-events.patch @@ -0,0 +1,61 @@ +From 66138b4e5f308cb0a9e93faa8aebf893a30f35ec Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 5 Jul 2019 15:06:55 -0700 +Subject: [PATCH] VNC: reverse key order when sending key up events + +When map_and_send_key maps an input to multiple key presses - +e.g. a ':' requires a press of shift and a press of ';', or +when dealing with any input like "ctrl-t" - it gets an array, +sends a 'down' event for each key in the array, then sends an +'up' event for each key in the array. So for our ctrl-t example +it does this: + +ctrl down +t down +ctrl up +t up + +This is a bit odd and not how humans normally type. Humans +would normally hold the modifier key, press and release any +modified keys they want to press, then release the modifier. +I've run into one issue previously where this caused a problem, +which was ultimately fixed in qemu so that os-autoinst's unusual +key event order worked OK. Now I've run into another: + +https://bugzilla.redhat.com/show_bug.cgi?id=1727388 + +All the details of that bug are still not worked out, but today +I *did* work out that changing this key press order avoids that +bug. By simply reversing the array for the key up events, so we +do this instead: + +ctrl down +t down +t up +ctrl up + +The bug stops happening. Since it's triggered two bugs now, and +as I said it does not map to how humans type, I think we should +really go ahead and change this. + +Signed-off-by: Adam Williamson +--- + consoles/VNC.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/consoles/VNC.pm b/consoles/VNC.pm +index 8eaefe0a..2dfc7a38 100644 +--- a/consoles/VNC.pm ++++ b/consoles/VNC.pm +@@ -759,7 +759,7 @@ sub map_and_send_key { + } + usleep(2_000); + if (!defined $down_flag || $down_flag == 0) { +- for my $key (@events) { ++ for my $key (reverse @events) { + $self->send_key_event_up($key); + } + } +-- +2.22.0 + diff --git a/os-autoinst.spec b/os-autoinst.spec index 8249966..99a73dc 100644 --- a/os-autoinst.spec +++ b/os-autoinst.spec @@ -30,11 +30,15 @@ Name: os-autoinst Version: %{github_version} -Release: 17%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} +Release: 18%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} Summary: OS-level test automation License: GPLv2+ URL: https://os-autoinst.github.io/openQA/ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz +# https://github.com/os-autoinst/os-autoinst/pull/1174 +# Reverse key order when sending up events for multi-key presses +# Works around https://bugzilla.redhat.com/show_bug.cgi?id=1727388 +Patch0: 0001-VNC-reverse-key-order-when-sending-key-up-events.patch BuildRequires: autoconf BuildRequires: automake @@ -223,6 +227,9 @@ make check VERBOSE=1 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf %changelog +* Fri Jul 05 2019 Adam Williamson - 4.5-18.20190527git43185de +- Backport #1174 to work around RHBZ #1727388 (key press order) + * Fri May 31 2019 Jitka Plesnikova - 4.5-17.20190527git43185de - Perl 5.30 rebuild