From 4d07fc585b7cb8784deaf98afa432082f36fc981 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 23 Sep 2011 10:51:53 +0300 Subject: The cursor can get offscreen in splitscreen landscape mode When input context is making the translation, it doesn't check if the translation is happening to the correct direction (i.e. upwards or downwards). As a fix, check if the cursor is still visible after making the translation. If it isn't apply the translation to the other direction. Task-number: QTBUG-21543 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 9025221..b830d50 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -1277,7 +1277,11 @@ void QCoeFepInputContext::translateInputWidget() // Translation should happen row-by-row, but initially it needs to ensure that cursor is visible. const qreal translation = m_transformation.height() ? cursor.height() : (cursorRect.bottom() - vkbRect.top()); - const qreal dy = -(qMin(maxY, translation)); + qreal dy = -(qMin(maxY, translation)); + + // Correct the translation direction, if the cursor rect would be moved outside of application area. + if ((cursorRect.bottom() + dy) < 0) + dy *= -1; // Do not allow transform above screen top, nor beyond scenerect if (m_transformation.height() + dy > 0 || gv->sceneRect().bottom() + m_transformation.height() < 0) { -- cgit v0.12