summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-04-25 16:36:45 +0100
committerPavel Grunt <pgrunt@redhat.com>2016-05-19 15:00:10 +0200
commitf697933524b19186cb078b5fca43f748fd68cf9f (patch)
treecd3e06d14deb30e8262255436ce8b22cd3b64fff /configure.ac
parent46d8442a3734b782b0934e46bbe8e1711b8d5412 (diff)
Spice-widget: Use new gdk_event_get_scancode if available
This new Gdk API allows in Windows to retrieve the raw scancodes sent by Windows. This allows us to do some translations getting the right value without many hacks and supporting all possible layouts. Windows convert the scancodes into virtual key codes. The translation is 1 -> N based on different condition. Also a single virtual key code can be originated from different scancodes. This make quite complicated (if not impossible) to get the original scancode from the hardware_keycode field (which in Windows is the virtual key). The additional check for native_scancode after calling this function allows to support key injection. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 38c5bab..7f29c66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,6 +142,18 @@ AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
SPICE_GTK_REQUIRES="${SPICE_GTK_REQUIRES} gtk+-3.0 >= $GTK_REQUIRED"
+# Check for gdk_event_get_scancode function
+# This was added in Gdk 3.22
+# The check allows the usage of the function in case the function is
+# backported or in case of compilation from Gdk master branch
+old_LIBS="$LIBS"
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $GTK_CFLAGS"
+LIBS="$LIBS $GTK_LIBS"
+AC_CHECK_FUNCS(gdk_event_get_scancode)
+LIBS="$old_LIBS"
+CFLAGS="$old_CFLAGS"
+
PKG_CHECK_EXISTS([gtk+-quartz-$with_gtk], [have_quartz=yes], [have_quartz=no])
AS_IF([test "x$have_quartz" = "xyes"], [AC_DEFINE([HAVE_QUARTZ], 1, [Have Quartz?])])
AM_CONDITIONAL([WITH_DISPLAY_QUARTZ], [test "x$have_quartz" = "xyes"])