From 5444ea50bb2b1b894d5b3c33676f9ef207fdcd1a Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Wed, 30 Dec 2015 00:08:17 +0100 Subject: Fix text-input support for new API Update text input support to upstream text-input protocol v2 from wayland-protocols. Remove support for input-method protocol for now. Map text-input protocol on compositor side to the Qt input method API, this allows to use any qt platform input method on compositor side (especially qtvirtualkeyboard). Add support for qtvirtualkeyboard to pure-qml example. Implement all missing functions of the text-input protocol. Change-Id: I597451ff65454a63dff86026b6a8d1ffbe07ce02 Done-with: Zeno Endemann Reviewed-by: Giulio Camuffo --- src/client/qwaylanddisplay.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/client/qwaylanddisplay.cpp') diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 7244363cd..a18b9853f 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -50,6 +50,7 @@ #include "qwaylandxdgshell_p.h" #include "qwaylandxdgsurface_p.h" #include "qwaylandwlshellsurface_p.h" +#include "qwaylandinputcontext_p.h" #include "qwaylandwindowmanagerintegration_p.h" #include "qwaylandshellintegration_p.h" @@ -60,7 +61,7 @@ #include "qwaylandtouch_p.h" #include "qwaylandqtkey_p.h" -#include +#include #include #include @@ -281,8 +282,11 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin mTouchExtension.reset(new QWaylandTouchExtension(this, id)); } else if (interface == QStringLiteral("qt_key_extension")) { mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id)); - } else if (interface == QStringLiteral("wl_text_input_manager")) { - mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id, 1)); + } else if (interface == QStringLiteral("zwp_text_input_manager_v2")) { + mTextInputManager.reset(new QtWayland::zwp_text_input_manager_v2(registry, id, 1)); + foreach (QWaylandInputDevice *inputDevice, mInputDevices) { + inputDevice->setTextInput(new QWaylandTextInput(this, mTextInputManager->get_text_input(inputDevice->wl_seat()))); + } } else if (interface == QStringLiteral("qt_hardware_integration")) { mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id)); // make a roundtrip here since we need to receive the events sent by -- cgit v1.2.3