[Spice-devel] [PATCH spice-gtk] vncdisplaykeymap: add wayland support

Hans de Goede hdegoede at redhat.com
Mon May 13 00:23:42 PDT 2013


ACK.

On 05/13/2013 01:13 AM, Marc-André Lureau wrote:
> The Wayland keycode are just Linux evdev, but the Gdk backend
> add the +8 offset used by Xorg evdev.
> ---
>   gtk/vncdisplaykeymap.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/gtk/vncdisplaykeymap.c b/gtk/vncdisplaykeymap.c
> index 8b01294..6d75424 100644
> --- a/gtk/vncdisplaykeymap.c
> +++ b/gtk/vncdisplaykeymap.c
> @@ -59,10 +59,19 @@ static struct {
>
>   static unsigned int ref_count_for_untranslated_keys = 0;
>
> +#ifdef GDK_WINDOWING_WAYLAND
> +#include <gdk/gdkwayland.h>
> +#endif
> +
>   #ifdef GDK_WINDOWING_BROADWAY
>   #include <gdk/gdkbroadway.h>
>   #endif
>
> +#if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
> +/* Xorg Linux + evdev (offset evdev keycodes) */
> +#include "vncdisplaykeymap_xorgevdev2xtkbd.c"
> +#endif
> +
>   #ifdef GDK_WINDOWING_X11
>   #include <gdk/gdkx.h>
>   #include <X11/XKBlib.h>
> @@ -225,6 +234,14 @@ const guint16 const *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,
>   	}
>   #endif
>
> +#ifdef GDK_WINDOWING_WAYLAND
> +	if (GDK_IS_WAYLAND_WINDOW(window)) {
> +		VNC_DEBUG("Using Wayland Xorg/evdev virtual keycode mapping");
> +		*maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd);
> +		return keymap_xorgevdev2xtkbd;
> +        }
> +#endif
> +
>   #ifdef GDK_WINDOWING_BROADWAY
>   	if (GDK_IS_BROADWAY_WINDOW(window)) {
>                   g_warning("experimental: using broadway, x11 virtual keysym mapping - with very limited support. See also https://bugzilla.gnome.org/show_bug.cgi?id=700105");
>


More information about the Spice-devel mailing list