Blame SOURCES/0028-Hook-up-queryKeyboardModifers.patch

6f97c1
From a6476d1a1c78eb7f17408241b268404e27b3e161 Mon Sep 17 00:00:00 2001
6f97c1
From: David Redondo <qt@david-redondo.de>
6f97c1
Date: Wed, 26 May 2021 14:49:40 +0200
147f94
Subject: [PATCH 28/36] Hook up queryKeyboardModifers
6f97c1
6f97c1
Can be useful when upon enter a modifiers event is received but no key
6f97c1
event so no QKeyEvent is generated.
6f97c1
6f97c1
Fixes: QTBUG-62786
6f97c1
Change-Id: I30b57fc78ce6d54d8f644ca95ba40e7e26eb24ed
6f97c1
Reviewed-by: Marco Martin <mart@kde.org>
6f97c1
Reviewed-by: David Edmundson <davidedmundson@kde.org>
6f97c1
6f97c1
6f97c1
(cherry picked from commit 4fa2baba8181ade4958a94e9531ec4f6919438a9)
6f97c1
---
6f97c1
 src/client/qwaylandintegration.cpp | 8 ++++++++
6f97c1
 src/client/qwaylandintegration_p.h | 2 ++
6f97c1
 2 files changed, 10 insertions(+)
6f97c1
6f97c1
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
6f97c1
index c53ccb78..e5e7dd42 100644
6f97c1
--- a/src/client/qwaylandintegration.cpp
6f97c1
+++ b/src/client/qwaylandintegration.cpp
6f97c1
@@ -262,6 +262,14 @@ QWaylandDisplay *QWaylandIntegration::display() const
6f97c1
     return mDisplay.data();
6f97c1
 }
6f97c1
 
6f97c1
+Qt::KeyboardModifiers QWaylandIntegration::queryKeyboardModifiers() const
6f97c1
+{
6f97c1
+    if (auto *seat = mDisplay->currentInputDevice()) {
6f97c1
+        return seat->modifiers();
6f97c1
+    }
6f97c1
+    return Qt::NoModifier;
6f97c1
+}
6f97c1
+
6f97c1
 QList<int> QWaylandIntegration::possibleKeys(const QKeyEvent *event) const
6f97c1
 {
6f97c1
     if (auto *seat = mDisplay->currentInputDevice())
6f97c1
diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h
6f97c1
index ff70ae25..73b80658 100644
6f97c1
--- a/src/client/qwaylandintegration_p.h
6f97c1
+++ b/src/client/qwaylandintegration_p.h
6f97c1
@@ -107,6 +107,8 @@ public:
6f97c1
 
6f97c1
     QWaylandDisplay *display() const;
6f97c1
 
6f97c1
+    Qt::KeyboardModifiers queryKeyboardModifiers() const override;
6f97c1
+
6f97c1
     QList<int> possibleKeys(const QKeyEvent *event) const override;
6f97c1
 
6f97c1
     QStringList themeNames() const override;
6f97c1
-- 
147f94
2.33.1
6f97c1