From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-stable@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL v2 02/11] ui: use evdev keymap when running under wayland
Date: Mon, 16 Jan 2017 09:31:16 +0000 [thread overview]
Message-ID: <20170116093116.GD13096@redhat.com> (raw)
In-Reply-To: <1483967385-12891-3-git-send-email-kraxel@redhat.com>
CC qemu-stable
This patch should go into active stable branches given that wayland is
now the default on some OS distro....
On Mon, Jan 09, 2017 at 02:09:36PM +0100, Gerd Hoffmann wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> 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>
> ---
> include/ui/gtk.h | 4 ++++
> ui/gtk.c | 7 +++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/include/ui/gtk.h b/include/ui/gtk.h
> index 42ca0fe..b3b5005 100644
> --- a/include/ui/gtk.h
> +++ b/include/ui/gtk.h
> @@ -18,6 +18,10 @@
> #include <X11/XKBlib.h>
> #endif
>
> +#ifdef GDK_WINDOWING_WAYLAND
> +#include <gdk/gdkwayland.h>
> +#endif
> +
> #if defined(CONFIG_OPENGL)
> #include "ui/egl-helpers.h"
> #include "ui/egl-context.h"
> 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 */
> --
> 1.8.3.1
>
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
next prev parent reply other threads:[~2017-01-16 9:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 13:09 [Qemu-devel] [PULL v2 00/11] ui patch queue Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 01/11] ui/gtk: fix crash at startup when no console is available Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 02/11] ui: use evdev keymap when running under wayland Gerd Hoffmann
2017-01-16 9:31 ` Daniel P. Berrange [this message]
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 03/11] console: add API to get underlying gui window ID Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 04/11] console: move window ID code from baum to sdl Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 05/11] sdl2: set window ID Gerd Hoffmann
2017-01-12 15:10 ` Stefan Weil
2017-01-12 15:56 ` Gerd Hoffmann
2017-01-12 17:05 ` Samuel Thibault
2017-01-12 19:07 ` Stefan Weil
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 06/11] egl-helpers: Change file licensing to LGPLv2 Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 07/11] gtk: avoid oob array access Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 08/11] ui: drop unused MOUSE_EVENT_WHEEL{UP, DN} defines Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 09/11] ui/vnc: Fix problem with sending too many bytes as server name Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 10/11] curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) Gerd Hoffmann
2017-01-09 13:09 ` [Qemu-devel] [PULL v2 11/11] ps2: Fix lost scancodes by recent changes Gerd Hoffmann
2017-01-09 13:49 ` [Qemu-devel] [PULL v2 00/11] ui patch queue Peter Maydell
2017-01-10 7:18 ` Gerd Hoffmann
2017-01-10 17:32 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170116093116.GD13096@redhat.com \
--to=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.