diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-02-15 17:46:37 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-02-15 20:44:08 +0100 |
commit | 41cffc379259fec626a282ca243a9750d96d1c63 (patch) | |
tree | 2c1c4c11a75dcdc66f1fc742a067bde42032994c /vcl/qt5 | |
parent | b7ee599c2ee4287cc39752db3b09444dcb65c0c2 (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>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Widget.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 68742b07c51e..4608482627be 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -681,10 +681,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: { |