From 323f300fd54d3fdb6f7a4565f305b631a27e76d5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 13 Jun 2016 10:18:29 +0200 Subject: 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 --- src/core/render_widget_host_view_qt.cpp | 7 +++++-- 1 file 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))); -- cgit v1.2.3