[Spice-commits] gtk/vncdisplaykeymap.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Mon May 13 03:01:34 PDT 2013


 gtk/vncdisplaykeymap.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 577263aaf4cffe260e31d19eb4b8bca1c253eff3
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Mon May 13 01:11:07 2013 +0200

    vncdisplaykeymap: add wayland support
    
    The Wayland keycode are just Linux evdev, but the Gdk backend
    add the +8 offset used by Xorg evdev.

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-commits mailing list