#endif /* no HAVE_CAIRO_EGL */
#include <xkbcommon/xkbcommon.h>
+#ifdef HAVE_XKBCOMMON_COMPOSE
#include <xkbcommon/xkbcommon-compose.h>
+#endif
#include <wayland-cursor.h>
#include <linux/input.h>
struct {
struct xkb_keymap *keymap;
struct xkb_state *state;
+#ifdef HAVE_XKBCOMMON_COMPOSE
struct xkb_compose_table *compose_table;
struct xkb_compose_state *compose_state;
+#endif
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
struct input *input = data;
struct xkb_keymap *keymap;
struct xkb_state *state;
+#ifdef HAVE_XKBCOMMON_COMPOSE
struct xkb_compose_table *compose_table;
struct xkb_compose_state *compose_state;
+#endif
char *locale;
char *map_str;
locale = "C";
/* Set up XKB compose table */
+#ifdef HAVE_XKBCOMMON_COMPOSE
compose_table =
xkb_compose_table_new_from_locale(input->display->xkb_context,
locale,
fprintf(stderr, "could not create XKB compose table for locale '%s'. "
"Disabiling compose\n", locale);
}
+#endif
xkb_keymap_unref(input->xkb.keymap);
xkb_state_unref(input->xkb.state);
static xkb_keysym_t
process_key_press(xkb_keysym_t sym, struct input *input)
{
+#ifdef HAVE_XKBCOMMON_COMPOSE
if (sym == XKB_KEY_NoSymbol)
return sym;
if (xkb_compose_state_feed(input->xkb.compose_state,
default:
return sym;
}
+#else
+ return sym;
+#endif
}
static void
if test x$enable_xkbcommon = xyes; then
AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon support])
COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
+ PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
+ [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
+ [Define if xkbcommon is 0.5.0 or newer])],
+ true)
fi
AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,