From a927dc97844fd23e295387f8174367f3f4be2977 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 25 Oct 2011 12:06:01 +0200 Subject: [PATCH] Fix QInputPanel::invokeAction(Click) not being called on mouse clicks It appears that the introduction of the KeyRelease event type check in commit 70cc5c9b7b420ecaf099d5d08fb1b4e8ad81a920 was accidential and meant to use MouseButtonRelease (in QSGTextInputPrivate::sendMouseEventToInputContext). This patch also removes the unnecessary QEvent::MouseMove check as well as the mousePos = -1 setting if the position is out of range. The input methods do the same check and reset() accordingly anyway. Change-Id: Icf3638979583d97c066cb639f80fa11f44538d7c Reviewed-by: Pekka Vuorela Reviewed-by: Andrew den Exter Reviewed-by: Joona Petrell --- src/declarative/items/qquicktextinput.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/declarative/items/qquicktextinput.cpp b/src/declarative/items/qquicktextinput.cpp index 4e26056..473dcd2 100644 --- a/src/declarative/items/qquicktextinput.cpp +++ b/src/declarative/items/qquicktextinput.cpp @@ -1162,16 +1162,9 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event) bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event) { #if !defined QT_NO_IM - if (control->composeMode() && event->type() == QEvent::KeyRelease) { + if (control->composeMode() && event->type() == QEvent::MouseButtonRelease) { int tmp_cursor = xToPos(event->localPos().x()); int mousePos = tmp_cursor - control->cursor(); - if (mousePos < 0 || mousePos > control->preeditAreaText().length()) { - mousePos = -1; - // don't send move events outside the preedit area - if (event->type() == QEvent::MouseMove) - return true; - } - // may be causing reset() in some input methods qApp->inputPanel()->invokeAction(QInputPanel::Click, mousePos); if (!control->preeditAreaText().isEmpty()) -- 2.7.4