Commit f83ededa authored by Aleksei Nikiforov's avatar Aleksei Nikiforov Committed by Qt Cherry-pick Bot
Browse files

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: default avatarLiang Qi <>
(cherry picked from commit 25a7034d

Reviewed-by: default avatarQt Cherry-pick Bot <>
parent d9009268
......@@ -60,11 +60,11 @@ Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s) const
ret |= Qt::ShiftModifier;
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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment