summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2016-06-13 10:18:29 +0200
committerAlexandru Croitor <alexandru.croitor@theqtcompany.com>2016-06-17 09:41:08 +0000
commit323f300fd54d3fdb6f7a4565f305b631a27e76d5 (patch)
tree2dfc73c620f96ac94efd4ef4e5eb3a38fef382fb /src
parent089f7968b4a730d88468211ab06208f43bb0613d (diff)
Always show caret when editing an IME pre-edit string.
Previously while entering a Japanese succession of characters, followed by transforming a substring into a word suggestion, the caret would disappear, and pressing the arrow keys would not indicate which part of the pre-edit string will be transformed next. This change makes sure the caret is always present, to indicate which part of the pre-edit string will be replaced by a possible IME suggestion. Change-Id: I350310c198bcacf0bcb48217f84b08e95ab8e8ef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/render_widget_host_view_qt.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 4ba7da7fc..deb273f49 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1056,8 +1056,11 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
break;
}
case QInputMethodEvent::Cursor:
- if (attribute.length)
- cursorPositionInPreeditString = attribute.start;
+ // Always set the position of the cursor, even if it's marked invisible by Qt, otherwise
+ // there is no way the user will know which part of the composition string will be
+ // changed, when performing an IME-specific action (like selecting a different word
+ // suggestion).
+ cursorPositionInPreeditString = attribute.start;
break;
case QInputMethodEvent::Selection:
selectionRange.set_start(qMin(attribute.start, (attribute.start + attribute.length)));