diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-09-05 16:10:41 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-17 00:39:59 +0000 |
commit | a12a811026baa86d7d8e4728d893114c76feec20 (patch) | |
tree | 102b3893f438dad2a48ebe3454ede5a2b2c218f0 /src/core/render_widget_host_view_qt.cpp | |
parent | a6d3799cf34569f5618e4b95f56a42f0e350e403 (diff) |
Commit the done-so-far IME composition on touch event
Fix is based on afc9e2d9674f7ab5800df4803cc68c71d1ae691a
Moreover, new quick auto test has been added to check that the commit
happens in case mouse and touch input events.
Task-number: QTBUG-62942
Change-Id: Ie9d55e0bb5b3bbc34c099502e735b94f37c5d5f8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 9968d3e49..980550620 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1414,6 +1414,19 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) break; } + if (m_imeInProgress && ev->type() == QEvent::TouchBegin) { + m_imeInProgress = false; + // Tell input method to commit the pre-edit string entered so far, and finish the + // composition operation. +#ifdef Q_OS_WIN + // Yes the function name is counter-intuitive, but commit isn't actually implemented + // by the Windows QPA, and reset does exactly what is necessary in this case. + qApp->inputMethod()->reset(); +#else + qApp->inputMethod()->commit(); +#endif + } + // Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE, // and ACTION_MOVE before ACTION_POINTER_UP. std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints); |