[Spice-devel] [PATCH spice-gtk 7/7] vncdisplaykeymap: add broadway support

Marc-André Lureau marcandre.lureau at gmail.com
Fri May 10 13:46:08 PDT 2013


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

diff --git a/gtk/vncdisplaykeymap.c b/gtk/vncdisplaykeymap.c
index b5241c1..8b01294 100644
--- a/gtk/vncdisplaykeymap.c
+++ b/gtk/vncdisplaykeymap.c
@@ -59,6 +59,10 @@ static struct {
 
 static unsigned int ref_count_for_untranslated_keys = 0;
 
+#ifdef GDK_WINDOWING_BROADWAY
+#include <gdk/gdkbroadway.h>
+#endif
+
 #ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
 #include <X11/XKBlib.h>
@@ -100,6 +104,17 @@ static unsigned int ref_count_for_untranslated_keys = 0;
 #endif
 #endif
 
+#ifdef GDK_WINDOWING_BROADWAY
+/* X11 keysyms */
+#include "vncdisplaykeymap_x112xtkbd.c"
+
+/* Gtk2 compat */
+#ifndef GDK_IS_BROADWAY_WINDOW
+#define GDK_IS_BROADWAY_WINDOW(win) (win == win)
+#endif
+
+#endif
+
 #ifdef GDK_WINDOWING_X11
 
 #define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0)
@@ -210,6 +225,15 @@ const guint16 const *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,
 	}
 #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");
+
+			*maplen = G_N_ELEMENTS(keymap_x112xtkbd);
+			return keymap_x112xtkbd;
+        }
+#endif
+
 	g_warning("Unsupported GDK Windowing platform.\n"
 		  "Disabling extended keycode tables.\n"
 		  "Please report to gtk-vnc-list at gnome.org\n"
-- 
1.8.2.1.342.gfa7285d



More information about the Spice-devel mailing list