diff options
author | Robert Griebl <robert.griebl@qt.io> | 2022-05-24 13:11:16 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2022-06-14 17:51:05 +0200 |
commit | 96e6f35fdb07795d59523bd8f91a2f3d7de21009 (patch) | |
tree | b3896e67c4ac9601d145edf3f36295e3d204527d /src/window-lib | |
parent | 60444d4a5db4f6d36d5c460eaf7cd098c3e9ad75 (diff) |
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
Pick-to: 6.3 6.4
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Diffstat (limited to 'src/window-lib')
-rw-r--r-- | src/window-lib/waylandcompositor.cpp | 14 | ||||
-rw-r--r-- | src/window-lib/waylandcompositor.h | 2 |
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; }; |