summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2021-10-28 13:13:58 +0200
committerLiang Qi <liang.qi@qt.io>2021-10-28 12:57:38 +0000
commitfdd9569c90b8c937a0830bb06e6f76685123b1a3 (patch)
treeeffdc214644d28d757e326d6d58488df77d6dc8b /src
parentf0a1fa7f905652b2aafd3e28ed2ff237ca7b10ef (diff)
downloadqtwayland-fdd9569c90b8c937a0830bb06e6f76685123b1a3.tar.gz
client: emit QInputMethod::visibleChanged() for qt_text_input_method_v1
Also emit keyboardRectangleChanged() when necessary. This amends f7885bb4eb2660ff4e287996061c9c1d987e5c60 . Pick-to: 6.2 Fixes: QTBUG-96298 Done-With: Paul Olav Tvete <paul.tvete@qt.io> Change-Id: I5095f9b921f85851c7525d45fe6f8fe219c963fb Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandinputmethodcontext.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/client/qwaylandinputmethodcontext.cpp b/src/client/qwaylandinputmethodcontext.cpp
index 4e81e1cd..f8c91411 100644
--- a/src/client/qwaylandinputmethodcontext.cpp
+++ b/src/client/qwaylandinputmethodcontext.cpp
@@ -43,6 +43,7 @@
#include <QtGui/qguiapplication.h>
#include <QtGui/qtextformat.h>
+#include <QtGui/private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -64,7 +65,10 @@ QWaylandTextInputMethod::~QWaylandTextInputMethod()
void QWaylandTextInputMethod::text_input_method_v1_visible_changed(int32_t visible)
{
- m_isVisible = visible;
+ if (m_isVisible != visible) {
+ m_isVisible = visible;
+ QGuiApplicationPrivate::platformIntegration()->inputContext()->emitInputPanelVisibleChanged();
+ }
}
void QWaylandTextInputMethod::text_input_method_v1_locale_changed(const QString &localeName)
@@ -79,10 +83,14 @@ void QWaylandTextInputMethod::text_input_method_v1_input_direction_changed(int32
void QWaylandTextInputMethod::text_input_method_v1_keyboard_rectangle_changed(wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
{
- m_keyboardRect = QRectF(wl_fixed_to_double(x),
- wl_fixed_to_double(y),
- wl_fixed_to_double(width),
- wl_fixed_to_double(height));
+ const QRectF keyboardRectangle(wl_fixed_to_double(x),
+ wl_fixed_to_double(y),
+ wl_fixed_to_double(width),
+ wl_fixed_to_double(height));
+ if (m_keyboardRect != keyboardRectangle) {
+ m_keyboardRect = keyboardRectangle;
+ QGuiApplicationPrivate::platformIntegration()->inputContext()->emitKeyboardRectChanged();
+ }
}
void QWaylandTextInputMethod::text_input_method_v1_start_input_method_event(uint32_t serial, int32_t surrounding_text_offset)