summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2022-05-24 13:11:16 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-15 11:24:22 +0000
commitf2eb85215c13fac9f9ea62250936a9c1344d5146 (patch)
tree12f101f8895eb268135033d41aabbb53a49e0c4d
parent0d7019e68f6ae6d5fde93f2bcd824d89d089d1a6 (diff)
downloadqtapplicationmanager-f2eb85215c13fac9f9ea62250936a9c1344d5146.tar.gz
Make both supported Wayland text-input protocols available for clients
Qt's own protocol is the more stable option, and chosen automatically by QtVirtualKeyboard if it is made available by the compositor. Change-Id: Ic8c65e81acd2e461bf078bec26794019e0aa855c Task-number: QTBUG-103580 Reviewed-by: Dominik Holland <dominik.holland@qt.io> (cherry picked from commit 96e6f35fdb07795d59523bd8f91a2f3d7de21009) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/window-lib/waylandcompositor.cpp14
-rw-r--r--src/window-lib/waylandcompositor.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/window-lib/waylandcompositor.cpp b/src/window-lib/waylandcompositor.cpp
index 540fd048..acc874fb 100644
--- a/src/window-lib/waylandcompositor.cpp
+++ b/src/window-lib/waylandcompositor.cpp
@@ -44,11 +44,9 @@
#include <QWaylandWlShell>
#include <QWaylandXdgShell>
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
-# include <private/qwaylandxdgshell_p.h>
-#endif
#include <QWaylandQuickOutput>
#include <QWaylandTextInputManager>
+#include <QWaylandQtTextInputMethodManager>
#include <QWaylandQtWindowManager>
#include "waylandqtamserverextension_p.h"
@@ -152,12 +150,22 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan
, m_wlShell(new QWaylandWlShell(this))
, m_xdgShell(new QWaylandXdgShell(this))
, m_amExtension(new WaylandQtAMServerExtension(this))
+ , m_qtTextInputMethodManager(new QWaylandQtTextInputMethodManager(this))
, m_textInputManager(new QWaylandTextInputManager(this))
{
+ // We are instantiating both the semi-official TextInputManager protocol (which has some
+ // traction upstream, but also has known defects) and our own QtTextInputMethodManager
+ // (which was added in Qt 6 to mimic our internal C++ interfaces and works perfectly stable).
+ // Clients can then choose which protocol they want to use. QtVirtualKeyboard will use the
+ // QtTextInputMethodManager automatically.
+ //TODO: find out, why all 6.4 based clients are crashing at startup, if we instantiate the two
+ // extensions in the opposite order.
+
m_wlShell->setParent(this);
m_xdgShell->setParent(this);
m_amExtension->setParent(this);
m_textInputManager->setParent(this);
+ m_qtTextInputMethodManager->setParent(this);
setSocketName(waylandSocketName.toUtf8());
registerOutputWindow(window);
diff --git a/src/window-lib/waylandcompositor.h b/src/window-lib/waylandcompositor.h
index d97f8cae..d0908beb 100644
--- a/src/window-lib/waylandcompositor.h
+++ b/src/window-lib/waylandcompositor.h
@@ -48,6 +48,7 @@ QT_FORWARD_DECLARE_CLASS(QWaylandResource)
QT_FORWARD_DECLARE_CLASS(QWaylandWlShell)
QT_FORWARD_DECLARE_CLASS(QWaylandWlShellSurface)
QT_FORWARD_DECLARE_CLASS(QWaylandTextInputManager)
+QT_FORWARD_DECLARE_CLASS(QWaylandQtTextInputMethodManager)
QT_FORWARD_DECLARE_CLASS(QWaylandXdgShell)
QT_FORWARD_DECLARE_CLASS(QWaylandXdgSurface)
@@ -140,6 +141,7 @@ protected:
QWaylandXdgShell *m_xdgShell;
QVector<QWaylandOutput *> m_outputs;
WaylandQtAMServerExtension *m_amExtension;
+ QWaylandQtTextInputMethodManager *m_qtTextInputMethodManager;
QWaylandTextInputManager *m_textInputManager;
QMap<uint, QPointer<WindowSurface>> m_xdgPingMap;
};