From 98a4861d5de8caeac6afbb8d4a50943b0bb71761 Mon Sep 17 00:00:00 2001 From: Aleksei Nikiforov Date: Tue, 3 Sep 2019 13:07:25 +0300 Subject: Qt xcb: remove false detects of Qt::GroupSwitchModifier In some cases, if X11 is configured with CapsLock as keyboard language switch key, and CapsLock is toggled via Shift+CapsLock key combination, toggled CapsLock is falsely detected as Qt::GroupSwitchModifier for subsequent key events. This change fixes this false detect, but doesn't fix detection of Qt::GroupSwitchModifier which is likely still broken. Fixes: QTBUG-49771 Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c Reviewed-by: Liang Qi (cherry picked from commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 9ab804ca1b..7495d0fdc3 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) + if ((s & rmod_masks.alt) == rmod_masks.alt) ret |= Qt::AltModifier; - if (s & rmod_masks.meta) + if ((s & rmod_masks.meta) == rmod_masks.meta) ret |= Qt::MetaModifier; - if (s & rmod_masks.altgr) + if ((s & rmod_masks.altgr) == rmod_masks.altgr) ret |= Qt::GroupSwitchModifier; return ret; } -- cgit v1.2.3