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

869fe3
From 75693b47dcac101f74f98e5902c4c6b39d407e4f 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
869fe3
Subject: [PATCH 15/40] 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
-- 
9fb289
2.35.1
6f97c1