aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-12-01 09:41:17 +0000
committerGerd Hoffmann <kraxel@redhat.com>2017-01-10 08:14:20 +0100
commita8ffb372a2202c65f42fdb69891ea68a2f274b55 (patch)
tree94eaab33c2805fd9d6ad9042bb28aadb5a1e38b4 /ui
parent3d4da9d6f3b664beb5bee446ad53b69178f46ad4 (diff)
downloadqemu-a8ffb372a2202c65f42fdb69891ea68a2f274b55.zip
qemu-a8ffb372a2202c65f42fdb69891ea68a2f274b55.tar.gz
qemu-a8ffb372a2202c65f42fdb69891ea68a2f274b55.tar.bz2
ui: use evdev keymap when running under wayland
Wayland always uses evdev as its input source, so QEMU can use the existing evdev keymap data Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20161201094117.16407-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 406de4f..356f400 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -90,6 +90,9 @@
#ifndef GDK_IS_X11_DISPLAY
#define GDK_IS_X11_DISPLAY(dpy) (dpy == dpy)
#endif
+#ifndef GDK_IS_WAYLAND_DISPLAY
+#define GDK_IS_WAYLAND_DISPLAY(dpy) (dpy == dpy)
+#endif
#ifndef GDK_IS_WIN32_DISPLAY
#define GDK_IS_WIN32_DISPLAY(dpy) (dpy == dpy)
#endif
@@ -1054,6 +1057,10 @@ static int gd_map_keycode(GtkDisplayState *s, GdkDisplay *dpy, int gdk_keycode)
qemu_keycode = translate_xfree86_keycode(gdk_keycode - 97);
}
#endif
+#ifdef GDK_WINDOWING_WAYLAND
+ } else if (GDK_IS_WAYLAND_DISPLAY(dpy) && gdk_keycode < 158) {
+ qemu_keycode = translate_evdev_keycode(gdk_keycode - 97);
+#endif
} else if (gdk_keycode == 208) { /* Hiragana_Katakana */
qemu_keycode = 0x70;
} else if (gdk_keycode == 211) { /* backslash */