forked from AuroraMiddleware/gtk
wayland: update to work with stable libxkbcommon
libxkbcommon has had some changes to its API. However, it now has a stable release (0.2.0), so this makes the necessary changes, and replaces all uses of the deprecated API. Signed-off-by: Ran Benita <ran234@gmail.com>
This commit is contained in:
parent
3338f6cb5b
commit
21cf5a7e00
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 *
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user