summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-12-14 17:14:06 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2019-04-16 10:14:30 +0000
commit458bc86f82f8fa6cfd659950549d1d2b36e5e40d (patch)
tree21d367bc0618a3d56eb64c3ccff0a2fd61c77147
parent60dc973ab2c9227e2b6161a8b61a8c129e8b8cbc (diff)
xkbcommon: replace deprecated APIsv5.13.0-beta3
See xkbcommon/xkbcommon-compat.h Change-Id: I2a70e14481db227fc0be657fbcf4f6550d62e7e8 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp8
-rw-r--r--src/shared/qwaylandxkb.cpp10
2 files changed, 8 insertions, 10 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index c92d00eb..e84eed64 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -230,10 +230,10 @@ void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state)
xkb_state_update_key(xkbState(), code, state == WL_KEYBOARD_KEY_STATE_PRESSED ? XKB_KEY_DOWN : XKB_KEY_UP);
- uint32_t modsDepressed = xkb_state_serialize_mods(xkbState(), (xkb_state_component)XKB_STATE_DEPRESSED);
- uint32_t modsLatched = xkb_state_serialize_mods(xkbState(), (xkb_state_component)XKB_STATE_LATCHED);
- uint32_t modsLocked = xkb_state_serialize_mods(xkbState(), (xkb_state_component)XKB_STATE_LOCKED);
- uint32_t group = xkb_state_serialize_group(xkbState(), (xkb_state_component)XKB_STATE_EFFECTIVE);
+ uint32_t modsDepressed = xkb_state_serialize_mods(xkbState(), XKB_STATE_MODS_DEPRESSED);
+ uint32_t modsLatched = xkb_state_serialize_mods(xkbState(), XKB_STATE_MODS_LATCHED);
+ uint32_t modsLocked = xkb_state_serialize_mods(xkbState(), XKB_STATE_MODS_LOCKED);
+ uint32_t group = xkb_state_serialize_layout(xkbState(), XKB_STATE_LAYOUT_EFFECTIVE);
if (this->modsDepressed == modsDepressed
&& this->modsLatched == modsLatched
diff --git a/src/shared/qwaylandxkb.cpp b/src/shared/qwaylandxkb.cpp
index 3cfc4b07..6a81e9fd 100644
--- a/src/shared/qwaylandxkb.cpp
+++ b/src/shared/qwaylandxkb.cpp
@@ -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;