From b80777c6d29701bf91920c7b310d43048b1e6cf8 Mon Sep 17 00:00:00 2001 From: ilya-fedin Date: Wed, 6 Oct 2021 14:23:43 +0400 Subject: [PATCH] Fix Qt scaling (#236) As it appeared, Qt scaling was never working since Kotato settings are read after option value is checked --- Telegram/SourceFiles/core/launcher.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index aacd4c7b8..e37d26249 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -295,11 +295,7 @@ void Launcher::init() { initQtMessageLogging(); QApplication::setApplicationName(qsl("KotatogramDesktop")); - if (cQtScale()) { - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); - } else { - QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); - } + QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); // fallback session management is useless for tdesktop since it doesn't have // any "are you sure you want to close this window?" dialogs @@ -325,6 +321,11 @@ int Launcher::exec() { Logs::start(this); Kotato::JsonSettings::Start(); + if (cQtScale()) { + QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, false); + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); + } + if (Logs::DebugEnabled()) { const auto openalLogPath = QDir::toNativeSeparators( cWorkingDir() + qsl("DebugLogs/last_openal_log.txt"));