summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay_p.h
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2024-03-05 16:08:00 +0000
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-03-10 16:51:56 +0000
commitfc3df6d3d62759e7abd2518792a77a1daf3fb6c8 (patch)
treeda7b02b9bbc93fba6fdb5f089288cfced01aa717 /src/client/qwaylanddisplay_p.h
parent95b8818ae1c3f24fb9dac1e59929c77a08b47b16 (diff)
Support multi-key for input context plugin
Sync from QPlatformInputContextFactory::requested in 8596998cb025a8338c9403f5ef9db5a23f5cc682 of qtbase to QPlatformInputContextFactory. Fixes: QTBUG-120202 Change-Id: Ib15d8a59c4cb3baaa19355ed5d7c30c87a7a1c16 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/client/qwaylanddisplay_p.h')
-rw-r--r--src/client/qwaylanddisplay_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index 234524925..5b564c8d7 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -40,6 +40,8 @@ struct wp_viewport;
QT_BEGIN_NAMESPACE
+#define WAYLAND_IM_KEY "wayland"
+
class QAbstractEventDispatcher;
class QSocketNotifier;
class QPlatformScreen;
@@ -253,7 +255,7 @@ public:
wl_event_queue *frameEventQueue() { return m_frameEventQueue; };
bool isKeyboardAvailable() const;
- bool isClientSideInputContextRequested() const;
+ bool isWaylandInputContextRequested() const;
void initEventThread();
@@ -357,9 +359,9 @@ private:
static const wl_callback_listener syncCallbackListener;
bool mWaylandTryReconnect = false;
- bool mClientSideInputContextRequested = [] () {
- const QString& requested = QPlatformInputContextFactory::requested();
- return !requested.isEmpty() && requested != QLatin1String("wayland");
+ bool mWaylandInputContextRequested = [] () {
+ const auto requested = QPlatformInputContextFactory::requested();
+ return requested.isEmpty() || requested.contains(QLatin1String(WAYLAND_IM_KEY));
}();
QStringList mTextInputManagerList;
int mTextInputManagerIndex = INT_MAX;