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

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