diff --git a/configure.ac b/configure.ac index 7e982dea89..de69ffe719 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,7 @@ if test "x$enable_wayland_backend" = "xyes"; then have_gio_unix=yes GDK_WINDOWING="$GDK_WINDOWING #define GDK_WINDOWING_WAYLAND" - WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon wayland-cursor" + WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon >= 0.2.0 wayland-cursor" if test "x$enable_wayland_cairo_gl" = "xyes"; then WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl" fi diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index cef1ddfc2c..5126e90494 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1241,14 +1241,14 @@ static GdkModifierType get_modifier (struct xkb_state *state) { GdkModifierType modifiers = 0; - modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_EFFECTIVE) > 0)?GDK_LOCK_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD1_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD2_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD3_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD4_MASK:0; - modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD5_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_LOCK_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD1_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD2_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD3_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD4_MASK:0; + modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD5_MASK:0; return modifiers; } @@ -1325,16 +1325,11 @@ deliver_key_event(GdkWaylandDevice *device, struct xkb_state *xkb_state; GdkKeymap *keymap; xkb_keysym_t sym; - uint32_t num_syms; - const xkb_keysym_t *syms; keymap = device->keymap; xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap); - num_syms = xkb_key_get_syms (xkb_state, key, &syms); - sym = XKB_KEY_NoSymbol; - if (num_syms == 1) - sym = syms[0]; + sym = xkb_state_key_get_one_sym (xkb_state, key); device->time = time; device->modifiers = get_modifier (xkb_state); diff --git a/gdk/wayland/gdkdisplaymanager-wayland.c b/gdk/wayland/gdkdisplaymanager-wayland.c index 1a327b3b57..e04a1ea012 100644 --- a/gdk/wayland/gdkdisplaymanager-wayland.c +++ b/gdk/wayland/gdkdisplaymanager-wayland.c @@ -136,7 +136,7 @@ gdk_wayland_display_manager_lookup_keyval (GdkDisplayManager *manager, { g_return_val_if_fail (keyval_name != NULL, 0); - return xkb_keysym_from_name(keyval_name); + return xkb_keysym_from_name (keyval_name, 0); } static gchar * diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c index b63079dbd0..4d10e67946 100644 --- a/gdk/wayland/gdkkeys-wayland.c +++ b/gdk/wayland/gdkkeys-wayland.c @@ -221,7 +221,7 @@ _gdk_wayland_keymap_new () names.layout = "us"; names.variant = ""; names.options = ""; - keymap->xkb_keymap = xkb_map_new_from_names(context, &names, XKB_MAP_COMPILE_PLACEHOLDER); + keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0); keymap->xkb_state = xkb_state_new (keymap->xkb_keymap); xkb_context_unref (context); @@ -246,7 +246,7 @@ _gdk_wayland_keymap_new_from_fd (uint32_t format, return NULL; } - keymap->xkb_keymap = xkb_map_new_from_string (context, map_str, format, XKB_MAP_COMPILE_PLACEHOLDER); + keymap->xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0); munmap (map_str, size); close (fd); keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);