aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2021-06-08 15:31:24 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2021-06-21 14:48:31 +0000
commitb9c70451ec5cb08bc9f823d4c3cf240a4f9931b1 (patch)
tree0fdd10d585bca11f5c2e4617c60b65855fbce040 /src
parentca5b712dfc8e67aece0eb7374ffe5921e2aa45e8 (diff)
plugins/openwnn: reset() should not modify pre-edit text
Per contract, the reset() function should not modify pre-edit text. This method is called by the input engine when the input method needs to be reset. The input method must reset its internal state only. The main difference to the update() method is that reset() modifies only the input method state, i.e. it must not modify the input context. Fix by clearing the internal state to avoid modifying pre-edit text. Task-number: QTBUG-94017 Pick-to: 5.15 6.1 6.2 Change-Id: I4482188bbe18292d3ef1721e529f09c6054baa5d Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/openwnn/plugin/openwnninputmethod.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/openwnn/plugin/openwnninputmethod.cpp b/src/plugins/openwnn/plugin/openwnninputmethod.cpp
index b3557cab..9cdce140 100644
--- a/src/plugins/openwnn/plugin/openwnninputmethod.cpp
+++ b/src/plugins/openwnn/plugin/openwnninputmethod.cpp
@@ -814,7 +814,7 @@ void OpenWnnInputMethod::selectionListItemSelected(QVirtualKeyboardSelectionList
void OpenWnnInputMethod::reset()
{
Q_D(OpenWnnInputMethod);
- d->commitAll();
+ d->composingText.clear();
d->initializeScreen();
d->fitInputType();
}
@@ -822,8 +822,10 @@ void OpenWnnInputMethod::reset()
void OpenWnnInputMethod::update()
{
Q_D(OpenWnnInputMethod);
- if (!d->disableUpdate)
+ if (!d->disableUpdate) {
+ d->commitAll();
reset();
+ }
}
} // namespace QtVirtualKeyboard