summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2023-07-11 13:13:47 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-12-13 07:29:51 +0000
commit59ae054ded4d74db53281d8087576cd05b979cd9 (patch)
treeb5ceca08b455770e7c359541fd7807fe2ae3838b /src/client
parent9c9f66a73dae53937af3f756fdbecc715fd3bbbb (diff)
Support TextInput V3 over v4-wip
Support for v4-wip was not added into any desktop linux compositors, nor was it ever enabled into the default Qt client builds for clients or compositor. TextInputV3 has become the most widely deployed. Whilst changes are needed, they do not need to be breaking changes. A second iteration of V3 can add the features we need. This is now in motion upstream. For cases where QtWaylandCompositor is used, the custom Qt text input method is preferred to work with the Qt virtual keyboard. Pick-to: 6.7 Change-Id: I01e2686c67846804c0069f1495952b530547f91c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/CMakeLists.txt10
-rw-r--r--src/client/qwaylanddisplay.cpp47
-rw-r--r--src/client/qwaylanddisplay_p.h10
-rw-r--r--src/client/qwaylandinputcontext.cpp6
-rw-r--r--src/client/qwaylandinputdevice.cpp10
-rw-r--r--src/client/qwaylandintegration.cpp6
-rw-r--r--src/client/qwaylandtextinputv3.cpp (renamed from src/client/qwaylandtextinputv4.cpp)68
-rw-r--r--src/client/qwaylandtextinputv3_p.h (renamed from src/client/qwaylandtextinputv4_p.h)26
8 files changed, 74 insertions, 109 deletions
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 4fab5b319..67ee5c865 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -36,6 +36,7 @@ qt_internal_add_module(WaylandClient
qwaylandinputcontext.cpp qwaylandinputcontext_p.h
qwaylandtextinputv1.cpp qwaylandtextinputv1_p.h
qwaylandtextinputv2.cpp qwaylandtextinputv2_p.h
+ qwaylandtextinputv3.cpp qwaylandtextinputv3_p.h
qwaylandtextinputinterface.cpp qwaylandtextinputinterface_p.h
qwaylandinputdevice.cpp qwaylandinputdevice_p.h
qwaylandinputmethodcontext.cpp qwaylandinputmethodcontext_p.h
@@ -87,7 +88,7 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/tablet-unstable-v2.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/text-input-unstable-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/text-input-unstable-v2.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/text-input-unstable-v4-wip.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/text-input-unstable-v3.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/wayland.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/wp-primary-selection-unstable-v1.xml
${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-output-unstable-v1.xml
@@ -126,13 +127,6 @@ qt_internal_extend_target(WaylandClient CONDITION QT_FEATURE_tabletevent
qwaylandtabletv2.cpp qwaylandtabletv2_p.h
)
-qt_internal_extend_target(WaylandClient CONDITION QT_FEATURE_wayland_text_input_v4_wip
- SOURCES
- qwaylandtextinputv4.cpp qwaylandtextinputv4_p.h
- DEFINES
- QT_WAYLAND_TEXT_INPUT_V4_WIP=1
-)
-
qt_internal_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard
SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index c9de99828..0c73fdc37 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -26,9 +26,7 @@
#include "qwaylandhardwareintegration_p.h"
#include "qwaylandtextinputv1_p.h"
#include "qwaylandtextinputv2_p.h"
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
-#include "qwaylandtextinputv4_p.h"
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+#include "qwaylandtextinputv3_p.h"
#include "qwaylandinputcontext_p.h"
#include "qwaylandinputmethodcontext_p.h"
@@ -47,7 +45,7 @@
#include <QtWaylandClient/private/qwayland-text-input-unstable-v1.h>
#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
-#include <QtWaylandClient/private/qwayland-text-input-unstable-v4-wip.h>
+#include <QtWaylandClient/private/qwayland-text-input-unstable-v3.h>
#include <QtWaylandClient/private/qwayland-wp-primary-selection-unstable-v1.h>
#include <QtWaylandClient/private/qwayland-qt-text-input-method-unstable-v1.h>
#include <QtWaylandClient/private/qwayland-fractional-scale-v1.h>
@@ -556,15 +554,13 @@ void QWaylandDisplay::checkTextInputProtocol()
{
QStringList tips, timps; // for text input protocols and text input manager protocols
tips << QLatin1String(QtWayland::qt_text_input_method_v1::interface()->name)
+ << QLatin1String(QtWayland::zwp_text_input_v3::interface()->name)
<< QLatin1String(QtWayland::zwp_text_input_v2::interface()->name)
<< QLatin1String(QtWayland::zwp_text_input_v1::interface()->name);
timps << QLatin1String(QtWayland::qt_text_input_method_manager_v1::interface()->name)
+ << QLatin1String(QtWayland::zwp_text_input_manager_v3::interface()->name)
<< QLatin1String(QtWayland::zwp_text_input_manager_v2::interface()->name)
<< QLatin1String(QtWayland::zwp_text_input_manager_v1::interface()->name);
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- tips << QLatin1String(QtWayland::zwp_text_input_v4::interface()->name);
- timps << QLatin1String(QtWayland::zwp_text_input_manager_v4::interface()->name);
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
QString tiProtocols = QString::fromLocal8Bit(qgetenv("QT_WAYLAND_TEXT_INPUT_PROTOCOL"));
qCDebug(lcQpaWayland) << "QT_WAYLAND_TEXT_INPUT_PROTOCOL=" << tiProtocols;
@@ -656,9 +652,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
if (mTextInputManagerIndex < INT_MAX) {
mGlobals.textInputManagerv1.reset();
mGlobals.textInputManagerv2.reset();
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- mGlobals.textInputManagerv4.reset();
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ mGlobals.textInputManagerv3.reset();
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
inputDevice->setTextInput(nullptr);
}
@@ -678,9 +672,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
if (mTextInputManagerIndex < INT_MAX) {
mGlobals.textInputMethodManager.reset();
mGlobals.textInputManagerv2.reset();
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- mGlobals.textInputManagerv4.reset();
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ mGlobals.textInputManagerv3.reset();
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
inputDevice->setTextInputMethod(nullptr);
}
@@ -702,9 +694,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
if (mTextInputManagerIndex < INT_MAX) {
mGlobals.textInputMethodManager.reset();
mGlobals.textInputManagerv1.reset();
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- mGlobals.textInputManagerv4.reset();
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ mGlobals.textInputManagerv3.reset();
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
inputDevice->setTextInputMethod(nullptr);
}
@@ -716,10 +706,9 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
this, mGlobals.textInputManagerv2->get_text_input(inputDevice->wl_seat())));
mWaylandIntegration->reconfigureInputContext();
mTextInputManagerIndex = mTextInputManagerList.indexOf(interface);
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- } else if (interface == QLatin1String(QtWayland::zwp_text_input_manager_v4::interface()->name)
+ } else if (interface == QLatin1String(QtWayland::zwp_text_input_manager_v3::interface()->name)
&& (mTextInputManagerList.contains(interface) && mTextInputManagerList.indexOf(interface) < mTextInputManagerIndex)) {
- qCDebug(lcQpaWayland) << "text input: register zwp_text_input_v4";
+ qCDebug(lcQpaWayland) << "text input: register zwp_text_input_v3";
if (mTextInputManagerIndex < INT_MAX) {
mGlobals.textInputMethodManager.reset();
mGlobals.textInputManagerv2.reset();
@@ -727,15 +716,15 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
inputDevice->setTextInputMethod(nullptr);
}
- mGlobals.textInputManagerv4.reset(
- new QtWayland::zwp_text_input_manager_v4(registry, id, 1));
+ mGlobals.textInputManagerv3.reset(
+ new QtWayland::zwp_text_input_manager_v3(registry, id, 1));
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
- inputDevice->setTextInput(new QWaylandTextInputv4(
- this, mGlobals.textInputManagerv4->get_text_input(inputDevice->wl_seat())));
+ inputDevice->setTextInput(new QWaylandTextInputv3(
+ this, mGlobals.textInputManagerv3->get_text_input(inputDevice->wl_seat())));
+
mWaylandIntegration->reconfigureInputContext();
mTextInputManagerIndex = mTextInputManagerList.indexOf(interface);
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
- } else if (interface == QLatin1String(QWaylandHardwareIntegration::interface()->name)) {
+ }else if (interface == QLatin1String(QWaylandHardwareIntegration::interface()->name)) {
bool disableHardwareIntegration = qEnvironmentVariableIntValue("QT_WAYLAND_DISABLE_HW_INTEGRATION");
if (!disableHardwareIntegration) {
mGlobals.hardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
@@ -805,14 +794,12 @@ void QWaylandDisplay::registry_global_remove(uint32_t id)
inputDevice->setTextInput(nullptr);
mWaylandIntegration->reconfigureInputContext();
}
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- if (global.interface == QLatin1String(QtWayland::zwp_text_input_manager_v4::interface()->name)) {
- mGlobals.textInputManagerv4.reset();
+ if (global.interface == QLatin1String(QtWayland::zwp_text_input_manager_v3::interface()->name)) {
+ mGlobals.textInputManagerv3.reset();
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
inputDevice->setTextInput(nullptr);
mWaylandIntegration->reconfigureInputContext();
}
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
if (global.interface == QLatin1String(QtWayland::qt_text_input_method_manager_v1::interface()->name)) {
mGlobals.textInputMethodManager.reset();
for (QWaylandInputDevice *inputDevice : std::as_const(mInputDevices))
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index 62ef71bd0..74c9aede4 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -49,7 +49,7 @@ namespace QtWayland {
class qt_surface_extension;
class zwp_text_input_manager_v1;
class zwp_text_input_manager_v2;
- class zwp_text_input_manager_v4;
+ class zwp_text_input_manager_v3;
class qt_text_input_method_manager_v1;
class wp_cursor_shape_manager_v1;
class wp_fractional_scale_manager_v1;
@@ -176,9 +176,9 @@ public:
{
return mGlobals.textInputManagerv2.get();
}
- QtWayland::zwp_text_input_manager_v4 *textInputManagerv4() const
+ QtWayland::zwp_text_input_manager_v3 *textInputManagerv3() const
{
- return mGlobals.textInputManagerv4.get();
+ return mGlobals.textInputManagerv3.get();
}
QWaylandHardwareIntegration *hardwareIntegration() const
{
@@ -205,6 +205,7 @@ public:
return mGlobals.xdgToplevelDragManager.get();
}
+
struct RegistryGlobal {
uint32_t id;
QString interface;
@@ -329,7 +330,7 @@ private:
std::unique_ptr<QtWayland::qt_text_input_method_manager_v1> textInputMethodManager;
std::unique_ptr<QtWayland::zwp_text_input_manager_v1> textInputManagerv1;
std::unique_ptr<QtWayland::zwp_text_input_manager_v2> textInputManagerv2;
- std::unique_ptr<QtWayland::zwp_text_input_manager_v4> textInputManagerv4;
+ std::unique_ptr<QtWayland::zwp_text_input_manager_v3> textInputManagerv3;
std::unique_ptr<QWaylandHardwareIntegration> hardwareIntegration;
std::unique_ptr<QWaylandXdgOutputManagerV1> xdgOutputManager;
std::unique_ptr<QtWayland::wp_viewporter> viewporter;
@@ -337,7 +338,6 @@ private:
std::unique_ptr<QtWayland::wp_cursor_shape_manager_v1> cursorShapeManager;
std::unique_ptr<QtWayland::qt_toplevel_drag_manager_v1> xdgToplevelDragManager;
} mGlobals;
-
int mFd = -1;
int mWritableNotificationFd = -1;
QList<RegistryGlobal> mRegistryGlobals;
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
index 369a4e5c2..4b6a34c6b 100644
--- a/src/client/qwaylandinputcontext.cpp
+++ b/src/client/qwaylandinputcontext.cpp
@@ -35,11 +35,7 @@ QWaylandInputContext::~QWaylandInputContext()
bool QWaylandInputContext::isValid() const
{
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- return mDisplay->textInputManagerv2() != nullptr || mDisplay->textInputManagerv1() != nullptr || mDisplay->textInputManagerv4() != nullptr;
-#else // QT_WAYLAND_TEXT_INPUT_V4_WIP
- return mDisplay->textInputManagerv2() != nullptr || mDisplay->textInputManagerv1() != nullptr;
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ return mDisplay->textInputManagerv2() != nullptr || mDisplay->textInputManagerv1() != nullptr || mDisplay->textInputManagerv3() != nullptr;
}
void QWaylandInputContext::reset()
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 0446dff49..f52789fdc 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -4,6 +4,7 @@
#include "qwaylandinputdevice_p.h"
#include "qwaylandintegration_p.h"
+#include "qwaylandtextinputv3_p.h"
#include "qwaylandwindow_p.h"
#include "qwaylandsurface_p.h"
#include "qwaylandbuffer_p.h"
@@ -25,9 +26,6 @@
#include "qwaylandshmbackingstore_p.h"
#include "qwaylandtextinputv1_p.h"
#include "qwaylandtextinputv2_p.h"
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
-#include "qwaylandtextinputv4_p.h"
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
#include "qwaylandtextinputinterface_p.h"
#include "qwaylandinputcontext_p.h"
#include "qwaylandinputmethodcontext_p.h"
@@ -408,10 +406,8 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version,
if (mQDisplay->textInputManagerv2())
mTextInput.reset(new QWaylandTextInputv2(mQDisplay, mQDisplay->textInputManagerv2()->get_text_input(wl_seat())));
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- if (mQDisplay->textInputManagerv4())
- mTextInput.reset(new QWaylandTextInputv4(mQDisplay, mQDisplay->textInputManagerv4()->get_text_input(wl_seat())));
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ if (mQDisplay->textInputManagerv3())
+ mTextInput.reset(new QWaylandTextInputv3(mQDisplay, mQDisplay->textInputManagerv3()->get_text_input(wl_seat())));
if (mQDisplay->textInputMethodManager())
mTextInputMethod.reset(new QWaylandTextInputMethod(mQDisplay, mQDisplay->textInputMethodManager()->get_text_input_method(wl_seat())));
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 88a2fa7e1..846556d4e 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -470,11 +470,7 @@ void QWaylandIntegration::reconfigureInputContext()
if (!mDisplay->isClientSideInputContextRequested()) {
if (mDisplay->textInputMethodManager() != nullptr)
mInputContext.reset(new QWaylandInputMethodContext(mDisplay.data()));
-#if QT_WAYLAND_TEXT_INPUT_V4_WIP
- else if (mDisplay->textInputManagerv1() != nullptr || mDisplay->textInputManagerv2() != nullptr || mDisplay->textInputManagerv4() != nullptr)
-#else // QT_WAYLAND_TEXT_INPUT_V4_WIP
- else if (mDisplay->textInputManagerv1() != nullptr || mDisplay->textInputManagerv2() != nullptr)
-#endif // QT_WAYLAND_TEXT_INPUT_V4_WIP
+ else if (mDisplay->textInputManagerv1() != nullptr || mDisplay->textInputManagerv2() != nullptr || mDisplay->textInputManagerv3() != nullptr)
mInputContext.reset(new QWaylandInputContext(mDisplay.data()));
} else {
mInputContext.reset(QPlatformInputContextFactory::create(requested));
diff --git a/src/client/qwaylandtextinputv4.cpp b/src/client/qwaylandtextinputv3.cpp
index 6cf01613f..a369cac67 100644
--- a/src/client/qwaylandtextinputv4.cpp
+++ b/src/client/qwaylandtextinputv3.cpp
@@ -1,7 +1,7 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#include "qwaylandtextinputv4_p.h"
+#include "qwaylandtextinputv3_p.h"
#include "qwaylandwindow_p.h"
#include "qwaylandinputmethodeventbuilder_p.h"
@@ -18,20 +18,20 @@ Q_LOGGING_CATEGORY(qLcQpaWaylandTextInput, "qt.qpa.wayland.textinput")
namespace QtWaylandClient {
-QWaylandTextInputv4::QWaylandTextInputv4(QWaylandDisplay *display,
- struct ::zwp_text_input_v4 *text_input)
- : QtWayland::zwp_text_input_v4(text_input)
+QWaylandTextInputv3::QWaylandTextInputv3(QWaylandDisplay *display,
+ struct ::zwp_text_input_v3 *text_input)
+ : QtWayland::zwp_text_input_v3(text_input)
, m_display(display)
{
}
-QWaylandTextInputv4::~QWaylandTextInputv4()
+QWaylandTextInputv3::~QWaylandTextInputv3()
{
}
namespace {
-const Qt::InputMethodQueries supportedQueries4 = Qt::ImEnabled |
+const Qt::InputMethodQueries supportedQueries3 = Qt::ImEnabled |
Qt::ImSurroundingText |
Qt::ImCursorPosition |
Qt::ImAnchorPosition |
@@ -39,7 +39,7 @@ const Qt::InputMethodQueries supportedQueries4 = Qt::ImEnabled |
Qt::ImCursorRectangle;
}
-void QWaylandTextInputv4::zwp_text_input_v4_enter(struct ::wl_surface *surface)
+void QWaylandTextInputv3::zwp_text_input_v3_enter(struct ::wl_surface *surface)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
@@ -51,10 +51,10 @@ void QWaylandTextInputv4::zwp_text_input_v4_enter(struct ::wl_surface *surface)
m_pendingDeleteAfterText = 0;
enable();
- updateState(supportedQueries4, update_state_enter);
+ updateState(supportedQueries3, update_state_enter);
}
-void QWaylandTextInputv4::zwp_text_input_v4_leave(struct ::wl_surface *surface)
+void QWaylandTextInputv3::zwp_text_input_v3_leave(struct ::wl_surface *surface)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
@@ -63,10 +63,6 @@ void QWaylandTextInputv4::zwp_text_input_v4_leave(struct ::wl_surface *surface)
return;
}
- // QTBUG-97248: check commit_mode
- // Currently text-input-unstable-v4-wip is implemented with preedit_commit_mode
- // 'commit'
-
m_currentPreeditString.clear();
m_surface = nullptr;
@@ -76,7 +72,7 @@ void QWaylandTextInputv4::zwp_text_input_v4_leave(struct ::wl_surface *surface)
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << "Done";
}
-void QWaylandTextInputv4::zwp_text_input_v4_preedit_string(const QString &text, int32_t cursorBegin, int32_t cursorEnd)
+void QWaylandTextInputv3::zwp_text_input_v3_preedit_string(const QString &text, int32_t cursorBegin, int32_t cursorEnd)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << text << cursorBegin << cursorEnd;
@@ -88,7 +84,7 @@ void QWaylandTextInputv4::zwp_text_input_v4_preedit_string(const QString &text,
m_pendingPreeditString.cursorEnd = cursorEnd;
}
-void QWaylandTextInputv4::zwp_text_input_v4_commit_string(const QString &text)
+void QWaylandTextInputv3::zwp_text_input_v3_commit_string(const QString &text)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << text;
@@ -98,7 +94,7 @@ void QWaylandTextInputv4::zwp_text_input_v4_commit_string(const QString &text)
m_pendingCommitString = text;
}
-void QWaylandTextInputv4::zwp_text_input_v4_delete_surrounding_text(uint32_t beforeText, uint32_t afterText)
+void QWaylandTextInputv3::zwp_text_input_v3_delete_surrounding_text(uint32_t beforeText, uint32_t afterText)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << beforeText << afterText;
@@ -109,12 +105,12 @@ void QWaylandTextInputv4::zwp_text_input_v4_delete_surrounding_text(uint32_t bef
m_pendingDeleteAfterText = QWaylandInputMethodEventBuilder::indexFromWayland(m_surroundingText, afterText);
}
-void QWaylandTextInputv4::zwp_text_input_v4_done(uint32_t serial)
+void QWaylandTextInputv3::zwp_text_input_v3_done(uint32_t serial)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << "with serial" << serial << m_currentSerial;
// This is a case of double click.
- // text_input_v4 will ignore this done signal and just keep the selection of the clicked word.
+ // text_input_v3 will ignore this done signal and just keep the selection of the clicked word.
if (m_cursorPos != m_anchorPos && (m_pendingDeleteBeforeText != 0 || m_pendingDeleteAfterText != 0)) {
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << "Ignore done";
m_pendingDeleteBeforeText = 0;
@@ -177,22 +173,22 @@ void QWaylandTextInputv4::zwp_text_input_v4_done(uint32_t serial)
QCoreApplication::sendEvent(focusObject, &event);
if (serial == m_currentSerial)
- updateState(supportedQueries4, update_state_full);
+ updateState(supportedQueries3, update_state_full);
}
-void QWaylandTextInputv4::reset()
+void QWaylandTextInputv3::reset()
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
m_pendingPreeditString.clear();
}
-void QWaylandTextInputv4::enableSurface(::wl_surface *)
+void QWaylandTextInputv3::enableSurface(::wl_surface *)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
}
-void QWaylandTextInputv4::disableSurface(::wl_surface *surface)
+void QWaylandTextInputv3::disableSurface(::wl_surface *surface)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
@@ -202,15 +198,15 @@ void QWaylandTextInputv4::disableSurface(::wl_surface *surface)
}
}
-void QWaylandTextInputv4::commit()
+void QWaylandTextInputv3::commit()
{
m_currentSerial = (m_currentSerial < UINT_MAX) ? m_currentSerial + 1U: 0U;
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << "with serial" << m_currentSerial;
- QtWayland::zwp_text_input_v4::commit();
+ QtWayland::zwp_text_input_v3::commit();
}
-void QWaylandTextInputv4::updateState(Qt::InputMethodQueries queries, uint32_t flags)
+void QWaylandTextInputv3::updateState(Qt::InputMethodQueries queries, uint32_t flags)
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << queries << flags;
@@ -225,7 +221,7 @@ void QWaylandTextInputv4::updateState(Qt::InputMethodQueries queries, uint32_t f
if (!surface || (surface != m_surface))
return;
- queries &= supportedQueries4;
+ queries &= supportedQueries3;
bool needsCommit = false;
QInputMethodQueryEvent event(queries);
@@ -319,7 +315,7 @@ void QWaylandTextInputv4::updateState(Qt::InputMethodQueries queries, uint32_t f
}
if (queries & Qt::ImHints) {
- QWaylandInputMethodContentType contentType = QWaylandInputMethodContentType::convertV4(static_cast<Qt::InputMethodHints>(event.value(Qt::ImHints).toInt()));
+ QWaylandInputMethodContentType contentType = QWaylandInputMethodContentType::convertV3(static_cast<Qt::InputMethodHints>(event.value(Qt::ImHints).toInt()));
qCDebug(qLcQpaWaylandTextInput) << m_contentHint << contentType.hint;
qCDebug(qLcQpaWaylandTextInput) << m_contentPurpose << contentType.purpose;
@@ -338,33 +334,33 @@ void QWaylandTextInputv4::updateState(Qt::InputMethodQueries queries, uint32_t f
commit();
}
-void QWaylandTextInputv4::setCursorInsidePreedit(int cursor)
+void QWaylandTextInputv3::setCursorInsidePreedit(int cursor)
{
Q_UNUSED(cursor);
- qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV4: Input protocol \"text-input-unstable-v4-wip\" does not support setting cursor inside preedit. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
+ qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV3: Input protocol \"text-input-unstable-v3\" does not support setting cursor inside preedit. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
}
-bool QWaylandTextInputv4::isInputPanelVisible() const
+bool QWaylandTextInputv3::isInputPanelVisible() const
{
- qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV4: Input protocol \"text-input-unstable-v4-wip\" does not support querying input method visibility. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
+ qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV3: Input protocol \"text-input-unstable-v3\" does not support querying input method visibility. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
return false;
}
-QRectF QWaylandTextInputv4::keyboardRect() const
+QRectF QWaylandTextInputv3::keyboardRect() const
{
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO;
return m_cursorRect;
}
-QLocale QWaylandTextInputv4::locale() const
+QLocale QWaylandTextInputv3::locale() const
{
- qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV4: Input protocol \"text-input-unstable-v4-wip\" does not support querying input language. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
+ qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV3: Input protocol \"text-input-unstable-v3\" does not support querying input language. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
return QLocale();
}
-Qt::LayoutDirection QWaylandTextInputv4::inputDirection() const
+Qt::LayoutDirection QWaylandTextInputv3::inputDirection() const
{
- qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV4: Input protocol \"text-input-unstable-v4-wip\" does not support querying input direction. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
+ qCWarning(qLcQpaWaylandTextInput) << "QWaylandTextInputV3: Input protocol \"text-input-unstable-v3\" does not support querying input direction. Use qt-text-input-method-unstable-v1 instead for full support of Qt input method events.";
return Qt::LeftToRight;
}
diff --git a/src/client/qwaylandtextinputv4_p.h b/src/client/qwaylandtextinputv3_p.h
index 2f4263eba..8c5b93b9b 100644
--- a/src/client/qwaylandtextinputv4_p.h
+++ b/src/client/qwaylandtextinputv3_p.h
@@ -1,8 +1,8 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDTEXTINPUTV4_P_H
-#define QWAYLANDTEXTINPUTV4_P_H
+#ifndef QWAYLANDTEXTINPUTV3_P_H
+#define QWAYLANDTEXTINPUTV3_P_H
//
// W A R N I N G
@@ -16,7 +16,7 @@
//
#include "qwaylandtextinputinterface_p.h"
-#include <QtWaylandClient/private/qwayland-text-input-unstable-v4-wip.h>
+#include <QtWaylandClient/private/qwayland-text-input-unstable-v3.h>
#include <qwaylandinputmethodeventbuilder_p.h>
#include <QLoggingCategory>
@@ -31,11 +31,11 @@ namespace QtWaylandClient {
class QWaylandDisplay;
-class QWaylandTextInputv4 : public QtWayland::zwp_text_input_v4, public QWaylandTextInputInterface
+class QWaylandTextInputv3 : public QtWayland::zwp_text_input_v3, public QWaylandTextInputInterface
{
public:
- QWaylandTextInputv4(QWaylandDisplay *display, struct ::zwp_text_input_v4 *text_input);
- ~QWaylandTextInputv4() override;
+ QWaylandTextInputv3(QWaylandDisplay *display, struct ::zwp_text_input_v3 *text_input);
+ ~QWaylandTextInputv3() override;
void reset() override;
void commit() override;
@@ -53,12 +53,12 @@ public:
void disableSurface(::wl_surface *surface) override;
protected:
- void zwp_text_input_v4_enter(struct ::wl_surface *surface) override;
- void zwp_text_input_v4_leave(struct ::wl_surface *surface) override;
- void zwp_text_input_v4_preedit_string(const QString &text, int32_t cursor_begin, int32_t cursor_end) override;
- void zwp_text_input_v4_commit_string(const QString &text) override;
- void zwp_text_input_v4_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override;
- void zwp_text_input_v4_done(uint32_t serial) override;
+ void zwp_text_input_v3_enter(struct ::wl_surface *surface) override;
+ void zwp_text_input_v3_leave(struct ::wl_surface *surface) override;
+ void zwp_text_input_v3_preedit_string(const QString &text, int32_t cursor_begin, int32_t cursor_end) override;
+ void zwp_text_input_v3_commit_string(const QString &text) override;
+ void zwp_text_input_v3_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override;
+ void zwp_text_input_v3_done(uint32_t serial) override;
private:
QWaylandDisplay *m_display;
@@ -101,4 +101,4 @@ private:
QT_END_NAMESPACE
-#endif // QWAYLANDTEXTINPUTV4_P_H
+#endif // QWAYLANDTEXTINPUTV3_P_H