Blame SOURCES/0021-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch

165ad0
From 1e0519c6465335dd380ad8d8209969c71eb78d48 Mon Sep 17 00:00:00 2001
f8c1a9
From: Rodney Dawes <dobey.pwns@gmail.com>
f8c1a9
Date: Fri, 15 Oct 2021 12:55:33 -0400
165ad0
Subject: [PATCH 21/40] Fix the logic for decoding modifiers map in Wayland
f8c1a9
 text input protocol
f8c1a9
f8c1a9
Correctly check for the flags in the modifiers map when we get it from
f8c1a9
the compositor, instead of modifying the map in the for loop conditional.
f8c1a9
f8c1a9
[ChangeLog][QWaylandInputContext] Fix modifiers map decoding
f8c1a9
logic when receiving the map from the compositor.
f8c1a9
f8c1a9
Fixes: QTBUG-97094
f8c1a9
Pick-to: 6.2 5.15 5.12
f8c1a9
Change-Id: Idad19f7b1f4560d40abbb5b31032360cfe915261
f8c1a9
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
f8c1a9
---
f8c1a9
 src/client/qwaylandinputcontext.cpp | 6 ++++--
f8c1a9
 1 file changed, 4 insertions(+), 2 deletions(-)
f8c1a9
f8c1a9
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
f8c1a9
index 503fd735..e290baa2 100644
f8c1a9
--- a/src/client/qwaylandinputcontext.cpp
f8c1a9
+++ b/src/client/qwaylandinputcontext.cpp
f8c1a9
@@ -387,8 +387,10 @@ void QWaylandTextInput::zwp_text_input_v2_input_method_changed(uint32_t serial,
f8c1a9
 Qt::KeyboardModifiers QWaylandTextInput::modifiersToQtModifiers(uint32_t modifiers)
f8c1a9
 {
f8c1a9
     Qt::KeyboardModifiers ret = Qt::NoModifier;
f8c1a9
-    for (int i = 0; modifiers >>= 1; ++i) {
f8c1a9
-        ret |= m_modifiersMap[i];
f8c1a9
+    for (int i = 0; i < m_modifiersMap.size(); ++i) {
f8c1a9
+        if (modifiers & (1 << i)) {
f8c1a9
+            ret |= m_modifiersMap[i];
f8c1a9
+        }
f8c1a9
     }
f8c1a9
     return ret;
f8c1a9
 }
f8c1a9
-- 
165ad0
2.35.1
f8c1a9