summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandintegration.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-14 09:51:07 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-26 08:49:12 +0200
commitf7885bb4eb2660ff4e287996061c9c1d987e5c60 (patch)
tree0474204dab9a896a3bb2f5ccae0bd62794c42739 /src/client/qwaylandintegration.cpp
parent0a4ce63b6177538a9abed89daefc43cc47247fc1 (diff)
New input method protocol for use with Qt clients
We introduce an alternative input-method protocol, which is a one-to-one mapping to Qt's input method API. Input methods such as the virtual keyboard's hunspell integration is quite sensitive to the inner workings of the input method handling, both in terms of when state is updated and which updates are delivered when. With a one-to-one mapping we are able to match these expectations and keep a well-synchronized state. Task-number: QTBUG-85135 Task-number: QTBUG-85134 Change-Id: Id69c22a7b0885ea59f39fdcc8d663749af56c7ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r--src/client/qwaylandintegration.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 0aa18f098..764acc2d9 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -43,6 +43,7 @@
#include "qwaylandshmwindow_p.h"
#include "qwaylandinputdevice_p.h"
#include "qwaylandinputcontext_p.h"
+#include "qwaylandinputmethodcontext_p.h"
#include "qwaylandshmbackingstore_p.h"
#include "qwaylandnativeinterface_p.h"
#if QT_CONFIG(clipboard)
@@ -465,10 +466,14 @@ void QWaylandIntegration::reconfigureInputContext()
qCWarning(lcQpaWayland) << "qtvirtualkeyboard currently is not supported at client-side,"
" use QT_IM_MODULE=qtvirtualkeyboard at compositor-side.";
- if (requested.isNull())
- mInputContext.reset(new QWaylandInputContext(mDisplay.data()));
- else
+ if (requested.isNull()) {
+ if (mDisplay->textInputMethodManager() != nullptr)
+ mInputContext.reset(new QWaylandInputMethodContext(mDisplay.data()));
+ else
+ mInputContext.reset(new QWaylandInputContext(mDisplay.data()));
+ } else {
mInputContext.reset(QPlatformInputContextFactory::create(requested));
+ }
const QString defaultInputContext(QStringLiteral("compose"));
if ((!mInputContext || !mInputContext->isValid()) && requested != defaultInputContext)