diff --git a/0001-Use-scancode-instead-of-keycode-names.patch b/0001-Use-scancode-instead-of-keycode-names.patch new file mode 100644 index 0000000..8a6b198 --- /dev/null +++ b/0001-Use-scancode-instead-of-keycode-names.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 9 Mar 2018 09:30:00 +0100 +Subject: [spice-gtk] Use scancode instead of keycode names +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When running on Xwayland, the keycode mapping property is not available, +which causes unknown keycode mapping errors and the keyboard doesn't +work. + +Check for a known scancode (“XK_Page_Up”) which differs to distinguish +between “xfree86” and “evdev” when the there is no keycode name. + +Signed-off-by: Olivier Fourdan +Reviewed-by: Daniel P. Berrangé +Acked-by: Christophe Fergeau +--- + src/vncdisplaykeymap.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/vncdisplaykeymap.c b/src/vncdisplaykeymap.c +index 2a792136..86cc6bde 100644 +--- a/src/vncdisplaykeymap.c ++++ b/src/vncdisplaykeymap.c +@@ -174,11 +174,13 @@ const guint16 *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window, + VNC_DEBUG("Using xquartz keycode mapping"); + *maplen = G_N_ELEMENTS(keymap_xorgxquartz2xtkbd); + return keymap_xorgxquartz2xtkbd; +- } else if (keycodes && STRPREFIX(keycodes, "evdev")) { ++ } else if ((keycodes && STRPREFIX(keycodes, "evdev")) || ++ (XKeysymToKeycode(xdisplay, XK_Page_Up) == 0x70)) { + VNC_DEBUG("Using evdev keycode mapping"); + *maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd); + return keymap_xorgevdev2xtkbd; +- } else if (keycodes && STRPREFIX(keycodes, "xfree86")) { ++ } else if ((keycodes && STRPREFIX(keycodes, "xfree86")) || ++ (XKeysymToKeycode(xdisplay, XK_Page_Up) == 0x63)) { + VNC_DEBUG("Using xfree86 keycode mapping"); + *maplen = G_N_ELEMENTS(keymap_xorgkbd2xtkbd); + return keymap_xorgkbd2xtkbd; diff --git a/spice-gtk.spec b/spice-gtk.spec index 9d0639c..b0bbd17 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -2,7 +2,7 @@ Name: spice-gtk Version: 0.34 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -10,6 +10,7 @@ License: LGPLv2+ URL: http://spice-space.org/page/Spice-Gtk #VCS: git:git://anongit.freedesktop.org/spice/spice-gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 +Patch1: 0001-Use-scancode-instead-of-keycode-names.patch BuildRequires: git-core BuildRequires: intltool @@ -182,6 +183,10 @@ rm -f %{buildroot}%{_libdir}/*.la %{_bindir}/spicy-stats %changelog +* Wed May 30 2018 Christophe Fergeau - 0.34-5 +- Fix keyboard input under Xwayland + Resolves: rhbz#1512564 + * Fri Feb 09 2018 Fedora Release Engineering - 0.34-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild