summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-02-15 17:46:37 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-02-16 14:06:16 +0100
commitcb566a1806563f779690d79479ad5ba1ccef0460 (patch)
tree7f1eb4428053a4f5fb20c2a250cc9c55fac86e39
parentf19d95986756412e5d72047656eec17a720c5e57 (diff)
tdf#140207 Qt downscale the ExtTextInputPos
Qt reports the unscaled pixel values to the IM, so simply divide all values reported by SalEvent::ExtTextInputPos by the window's scale factor. This correctly positions the IM window on a scaled LO window. Change-Id: Ia639ee3e5fc0e47f7017896b34730bbda7f06a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110945 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 41cffc379259fec626a282ca243a9750d96d1c63) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110915 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 61bf6b4d90aa1d37009b397e44fe39c9c5b06afd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110920 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--vcl/qt5/Qt5Widget.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 0ef305f42949..92fd43afd27e 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -680,10 +680,11 @@ QVariant Qt5Widget::inputMethodQuery(Qt::InputMethodQuery property) const
}
case Qt::ImCursorRectangle:
{
+ const qreal fRatio = m_rFrame.devicePixelRatioF();
SalExtTextInputPosEvent aPosEvent;
m_rFrame.CallCallback(SalEvent::ExtTextInputPos, &aPosEvent);
- return QVariant(
- QRect(aPosEvent.mnX, aPosEvent.mnY, aPosEvent.mnWidth, aPosEvent.mnHeight));
+ return QVariant(QRect(aPosEvent.mnX / fRatio, aPosEvent.mnY / fRatio,
+ aPosEvent.mnWidth / fRatio, aPosEvent.mnHeight / fRatio));
}
case Qt::ImAnchorPosition:
{