Skip to content

Commit

Permalink
QScreen: Apply high-DPI scale to availableGeometry size, not position
Browse files Browse the repository at this point in the history
Treat geometry and availableGeometry in the same way so the position
is in native coordinates and only the size is scaled.

Task-number: QTBUG-128660
Change-Id: If1355014fd6dd1a204cab7177d7941c980dda0ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
  • Loading branch information
tsondergaard authored and torarnv committed Sep 26, 2024
1 parent 148f1a5 commit a0f53ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/kernel/qscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ void QScreenPrivate::updateGeometry()
qreal scaleFactor = QHighDpiScaling::factor(platformScreen);
QRect nativeGeometry = platformScreen->geometry();
geometry = QRect(nativeGeometry.topLeft(), QHighDpi::fromNative(nativeGeometry.size(), scaleFactor));
availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), scaleFactor, geometry.topLeft());
QRect nativeAvailableGeometry = platformScreen->availableGeometry();
availableGeometry = QRect(nativeAvailableGeometry.topLeft(), QHighDpi::fromNative(nativeAvailableGeometry.size(), scaleFactor));
}

/*!
Expand Down

0 comments on commit a0f53ec

Please sign in to comment.