Ceil device pixel ratio

Qt 6.4 provides QT_WIDGETS_HIGHDPI_DOWNSCALE that allows widgets to draw at integer device pixel ratio by using the next integer. Ceiling this value makes tdesktop in sync with technique and provides sharp content.

Without QT_WIDGETS_HIGHDPI_DOWNSCALE, this doesn't makes the content sharp, but the quality is still better as Qt attempts to downscale those graphic rather than upscale.
This commit is contained in:
Ilya Fedin 2022-09-02 19:28:11 +04:00 committed by John Preston
parent feb6107ce6
commit 4f261ced8e
1 changed files with 1 additions and 1 deletions

View File

@ -243,7 +243,7 @@ void Sandbox::setupScreenScale() {
LOG(("Environmental variables: QT_AUTO_SCREEN_SCALE_FACTOR='%1'").arg(qEnvironmentVariable("QT_AUTO_SCREEN_SCALE_FACTOR")));
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(qEnvironmentVariable("QT_SCREEN_SCALE_FACTORS")));
}
style::SetDevicePixelRatio(int(ratio));
style::SetDevicePixelRatio(std::ceil(ratio));
if (Platform::IsMac() && ratio == 2.) {
cSetScreenScale(110); // 110% for Retina screens by default.
} else {