From bb4b40b7e1b7cc0af2f0c74a991edf39d64cac06 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 17 Sep 2021 10:02:24 +0200 Subject: [PATCH] Revert "Qt xcb: remove false detects of Qt::GroupSwitchModifier" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d. The change makes the 5th modifier key broken, which is more serious than Backspace key doesn't work in CapsLock on. And we don't have a better solution for both of them now, perhaps it's better to keep the old behavior in 6.2 LTS. Task-number: QTBUG-49771 Fixes: QTBUG-95108 Fixes: QTBUG-95289 Pick-to: 6.2 6.2.0 5.15 Change-Id: Ie5d0aafa562b5097e089cafc83ae227c75c6d752 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 7495d0fdc3e..9ab804ca1b1 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -60,11 +60,11 @@ Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s) const ret |= Qt::ShiftModifier; if (s & XCB_MOD_MASK_CONTROL) ret |= Qt::ControlModifier; - if ((s & rmod_masks.alt) == rmod_masks.alt) + if (s & rmod_masks.alt) ret |= Qt::AltModifier; - if ((s & rmod_masks.meta) == rmod_masks.meta) + if (s & rmod_masks.meta) ret |= Qt::MetaModifier; - if ((s & rmod_masks.altgr) == rmod_masks.altgr) + if (s & rmod_masks.altgr) ret |= Qt::GroupSwitchModifier; return ret; }