[Android] Fix Text select handle misplaced on fields inside QDialog issues

Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod

Fixes: QTBUG-65229
Fixes: QTBUG-58503
Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Pekka Gehör 2020-12-21 16:37:25 +02:00 committed by Qt Cherry-pick Bot
parent 32734f351b
commit 8cb8dab030

View File

@ -645,8 +645,8 @@ void QAndroidInputContext::updateSelectionHandles()
}
auto curRect = im->cursorRectangle();
QPoint cursorPoint(curRect.center().x(), curRect.bottom());
QPoint editMenuPoint(curRect.x(), curRect.y());
QPoint cursorPoint = qGuiApp->focusWindow()->mapToGlobal(QPoint(curRect.x() + (curRect.width() / 2), curRect.y() + curRect.height()));
QPoint editMenuPoint(cursorPoint.x(), cursorPoint.y());
m_handleMode &= ShowEditPopup;
m_handleMode |= ShowCursor;
uint32_t buttons = EditContext::PasteButton;