From 4f261ced8ea242da4ed92e50447e2028d143eca8 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 2 Sep 2022 19:28:11 +0400 Subject: [PATCH] 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. --- Telegram/SourceFiles/core/sandbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 54523d98b..cc3f1ad62 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -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 {