xkbcommon: replace deprecated APIs

See xkbcommon/xkbcommon-compat.h

Change-Id: I2a70e14481db227fc0be657fbcf4f6550d62e7e8
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
Gatis Paeglis 2018-12-14 17:14:06 +01:00
parent 9f450e62b9
commit 19c4ae1adc

View File

@ -342,15 +342,13 @@ Qt::KeyboardModifiers QWaylandXkb::modifiers(struct xkb_state *state)
#if QT_CONFIG(xkbcommon)
Qt::KeyboardModifiers modifiers = Qt::NoModifier;
xkb_state_component cstate = static_cast<xkb_state_component>(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED);
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_SHIFT, cstate))
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_SHIFT, XKB_STATE_MODS_EFFECTIVE))
modifiers |= Qt::ShiftModifier;
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CTRL, cstate))
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE))
modifiers |= Qt::ControlModifier;
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_ALT, cstate))
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_ALT, XKB_STATE_MODS_EFFECTIVE))
modifiers |= Qt::AltModifier;
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_LOGO, cstate))
if (xkb_state_mod_name_is_active(state, XKB_MOD_NAME_LOGO, XKB_STATE_MODS_EFFECTIVE))
modifiers |= Qt::MetaModifier;
return modifiers;