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

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