summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-09-23 07:51:53 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-09-23 07:51:53 (GMT)
commit4d07fc585b7cb8784deaf98afa432082f36fc981 (patch)
tree5baa9ae03edcbebe4d31243d4d25a9b921795adf /src/gui/inputmethod
parentc6eac82ad48c3956a16cfa89105374003fc854d6 (diff)
downloadQt-4d07fc585b7cb8784deaf98afa432082f36fc981.zip
Qt-4d07fc585b7cb8784deaf98afa432082f36fc981.tar.gz
Qt-4d07fc585b7cb8784deaf98afa432082f36fc981.tar.bz2
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
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp6
1 files changed, 5 insertions, 1 deletions
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) {