From 0437835bded5c6e17bbe7032ebe883d057da01c3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 8 Feb 2020 18:11:33 -0800 Subject: [PATCH] Avoid enabling High DPI mode on EGLFS to fix font rendering --- app/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index f3fe24b0..3f6a8294 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -285,13 +285,17 @@ int main(int argc, char *argv[]) AntiHookingDummyImport(); #endif - // Enable High DPI support - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // Avoid using High DPI on EGLFS. It breaks font rendering. + // https://bugreports.qt.io/browse/QTBUG-64377 + if (QGuiApplication::platformName() != "eglfs") { + // Enable High DPI support + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - // Enable fractional High DPI scaling on Qt 5.14 and later - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); + // Enable fractional High DPI scaling on Qt 5.14 and later + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif + } // This avoids using the default keychain for SSL, which may cause // password prompts on macOS.