mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-24 09:16:57 +00:00
Fix remaining known xdg-output fractional scaling issues on Wayland
And enable it by default
This commit is contained in:
parent
85f56217a8
commit
e173c727f7
@ -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();
|
||||
|
@ -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
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 44161f183c255dc0dac7ebe9558a1ca48f5e5258
|
||||
Subproject commit 06360dea67358b62e21c014c4b0d20461d752c98
|
Loading…
Reference in New Issue
Block a user