diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-26 10:35:52 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-29 16:58:04 +0200 |
commit | fa12e9c1c3634696cf3e0754ab9c374456945efc (patch) | |
tree | 7729c6d1990dc2d9f4746c45e7fcae96d41a0128 /src/core/render_widget_host_view_qt.cpp | |
parent | 9d962bc9424c71a451d04741619c9597f3da8010 (diff) | |
parent | d044140246734b8851689f55197c03cfd29dec99 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I7094e85a7770303a2ae30baccbc484c04f33600e
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 f36de68c7..136371a91 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1418,6 +1418,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); |