summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2022-05-03 20:54:19 +0200
committerLiang Qi <liang.qi@qt.io>2022-06-28 20:26:29 +0000
commitef94aeef649f832bb201cb752407ce3ea5e66562 (patch)
tree17c55eebff54b63ba3829cca17357a92d55cc513
parentDoc: Document missing methods in QDropEvent (diff)
downloadqtbase-ef94aeef649f832bb201cb752407ce3ea5e66562.tar.xz
qtbase-ef94aeef649f832bb201cb752407ce3ea5e66562.zip
xcb: update xkb_state mask as much as possible
Though we can get xcb_xkb_state_notify_event_t for the change, but it looks like not enough, especially when a new usb barcode scanner was used, it should be a slave keyboard, and Qt only uses core_device_id for now. It should be enough to update xkb_state mask when we get key event. See also https://xkbcommon.org/doc/current/md_doc_quick_guide.html . Fixes: QTBUG-95933 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Ie1e82c19edd777630c7f9057a3b2b8b7cad59e38 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 79fef496b4..0666fac735 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -405,7 +405,7 @@ static xkb_layout_index_t lockedGroup(quint16 state)
void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
{
- if (m_config && !connection()->hasXKB()) {
+ if (m_config) {
struct xkb_state *xkbState = m_xkbState.get();
xkb_mod_mask_t modsDepressed = xkb_state_serialize_mods(xkbState, XKB_STATE_MODS_DEPRESSED);
xkb_mod_mask_t modsLatched = xkb_state_serialize_mods(xkbState, XKB_STATE_MODS_LATCHED);
@@ -427,7 +427,7 @@ void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo)
{
- if (m_config && !connection()->hasXKB()) {
+ if (m_config) {
auto *mods = static_cast<xcb_input_modifier_info_t *>(modInfo);
auto *group = static_cast<xcb_input_group_info_t *>(groupInfo);
const xkb_state_component changedComponents