From e173c727f7afedb150597918a58f7d0d5816104f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 5 Dec 2023 22:41:45 +0400 Subject: [PATCH] Fix remaining known xdg-output fractional scaling issues on Wayland And enable it by default --- Telegram/SourceFiles/core/sandbox.cpp | 8 ++------ Telegram/build/docker/centos_env/Dockerfile | 2 +- Telegram/lib_ui | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index bfbd3799cd007d..0b92376cd6b341 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -45,6 +45,7 @@ base::options::toggle OptionForceWaylandFractionalScaling({ "This works without fractional-scale-v1 and without " "precise High DPI scaling. " "Requires Qt with Desktop App Toolkit patches.", + .defaultValue = true, .scope = [] { #ifdef DESKTOP_APP_QT_PATCHED return Platform::IsWayland(); @@ -252,12 +253,7 @@ void Sandbox::setupScreenScale() { logEnv("QT_USE_PHYSICAL_DPI"); logEnv("QT_FONT_DPI"); - // Like Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor. - // Round up for .75 and higher. This favors "small UI" over "large UI". - const auto roundedRatio = ((ratio - qFloor(ratio)) < 0.75) - ? qFloor(ratio) - : qCeil(ratio); - const auto useRatio = std::clamp(roundedRatio, 1, 3); + const auto useRatio = std::clamp(qCeil(ratio), 1, 3); style::SetDevicePixelRatio(useRatio); const auto screen = Sandbox::primaryScreen(); diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 8c1a4f703397f0..a87d857df2f412 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -54,7 +54,7 @@ FROM builder AS patches RUN git init patches \ && cd patches \ && git remote add origin {{ GIT }}/desktop-app/patches.git \ - && git fetch --depth=1 origin 8b95f2787ee69f3ff16a62c68b39bb8bb3d0fa68 \ + && git fetch --depth=1 origin 12780ae73abe21d00ae125e284d8bca9d8993948 \ && git reset --hard FETCH_HEAD \ && rm -rf .git diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 44161f183c255d..06360dea67358b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 44161f183c255dc0dac7ebe9558a1ca48f5e5258 +Subproject commit 06360dea67358b62e21c014c4b0d20461d752c98