summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp')
-rw-r--r--src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp47
1 files changed, 17 insertions, 30 deletions
diff --git a/src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp b/src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp
index b37c1a9b8..355e77338 100644
--- a/src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp
+++ b/src/compositor/extensions/qwaylandqttextinputmethodmanager.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwaylandqttextinputmethodmanager.h"
#include "qwaylandqttextinputmethodmanager_p.h"
@@ -50,10 +24,17 @@ void QWaylandQtTextInputMethodManagerPrivate::text_input_method_manager_v1_get_t
if (textInput == nullptr)
textInput = new QWaylandQtTextInputMethod(seat, compositor);
textInput->add(resource->client(), id, wl_resource_get_version(resource->handle));
+ QWaylandClient *client = QWaylandClient::fromWlClient(compositor, resource->client());
+ QWaylandClient::TextInputProtocols p = client->textInputProtocols();
+ client->setTextInputProtocols(p.setFlag(QWaylandClient::TextInputProtocol::QtTextInputMethodV1));
+
+ if (!textInput->isInitialized())
+ textInput->initialize();
}
/*!
\qmltype QtTextInputMethodManager
+ \instantiates QWaylandQtTextInputMethodManager
\inqmlmodule QtWayland.Compositor
\since 6.0
\brief Provides access to input methods in the compositor.
@@ -62,7 +43,9 @@ void QWaylandQtTextInputMethodManagerPrivate::text_input_method_manager_v1_get_t
in the \c qt-text-input-method-unstable-v1 extension protocol. It is specifically designed
to be used with a Qt-based input method, such as Qt Virtual Keyboard.
- To use it, simply instanitate a \c QtTextInputMethodManager object inside the \l WaylandCompositor.
+ Instantiating this as child of a \l WaylandCompositor adds it to the list of interfaces available
+ to the client. If a client binds to it, then it will be used to communciate text input to
+ that client.
*/
/*!
@@ -75,7 +58,9 @@ void QWaylandQtTextInputMethodManagerPrivate::text_input_method_manager_v1_get_t
in the \c qt-text-input-method-unstable-v1 extension protocol. It is specifically designed
to be used with a Qt-based input method, such as Qt Virtual Keyboard.
- To use it, simply instanitate a \c QtTextInputMethodManager object as a child of the \l QWaylandCompositor.
+ Instantiating this as child of a \l WaylandCompositor adds it to the list of interfaces available
+ to the client. If a client binds to it, then it will be used to communciate text input to
+ that client.
*/
QWaylandQtTextInputMethodManager::QWaylandQtTextInputMethodManager()
@@ -113,3 +98,5 @@ QByteArray QWaylandQtTextInputMethodManager::interfaceName()
}
QT_END_NAMESPACE
+
+#include "moc_qwaylandqttextinputmethodmanager.cpp"