summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-02-19 07:46:43 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-22 06:19:59 +0000
commitfb3081f7c0810198914bac29296618119bb0565c (patch)
tree969e4b87389aa69dbb953154ad8206c7899cc7be
parenta1330e8d0265d8ee339e5437ffe34a400d08a2d4 (diff)
downloadqtwayland-fb3081f7c0810198914bac29296618119bb0565c.tar.gz
Fix sending input hints with new text input protocol
Using input method hints to request things like digits-only etc. did not work with the specialized Qt input method for two reasons: First of all the full state of the editor needs to be sent to the keyboard when the focus object is set. But even fixing this, it turned out that the recipient was not actually registering the input methods hints, but just overwriting the function argument with itself. Fixes: QTBUG-91206 Change-Id: I1b8a3e92cc912bc06b6a2a60f8ea280393cd226e Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 7d7ca27985055b355a21bc8b8aa511a5b213d299) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandinputmethodcontext.cpp2
-rw-r--r--src/compositor/extensions/qwaylandqttextinputmethod.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/client/qwaylandinputmethodcontext.cpp b/src/client/qwaylandinputmethodcontext.cpp
index e6ab1da4..4e81e1cd 100644
--- a/src/client/qwaylandinputmethodcontext.cpp
+++ b/src/client/qwaylandinputmethodcontext.cpp
@@ -408,6 +408,8 @@ void QWaylandInputMethodContext::setFocusObject(QObject *)
m_currentWindow = window;
}
}
+
+ update(Qt::ImQueryAll);
}
}
diff --git a/src/compositor/extensions/qwaylandqttextinputmethod.cpp b/src/compositor/extensions/qwaylandqttextinputmethod.cpp
index 91895796..00d9da13 100644
--- a/src/compositor/extensions/qwaylandqttextinputmethod.cpp
+++ b/src/compositor/extensions/qwaylandqttextinputmethod.cpp
@@ -123,7 +123,7 @@ void QWaylandQtTextInputMethodPrivate::text_input_method_v1_start_update(Resourc
void QWaylandQtTextInputMethodPrivate::text_input_method_v1_update_hints(Resource *resource, int32_t hints)
{
if (this->resource == resource)
- hints = Qt::InputMethodHints(hints);
+ this->hints = Qt::InputMethodHints(hints);
}
void QWaylandQtTextInputMethodPrivate::text_input_method_v1_update_anchor_position(Resource *resource, int32_t anchorPosition)