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