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

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