From a9dc50e22dcfb9296c87ce8dfa432505d70fd253 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 3 Mar 2023 12:14:43 +0200 Subject: [PATCH] x11: Fix disabling high dpi scaling Qt::AA_DisableHighDpiScaling has no any effect now. --- src/main_x11.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main_x11.cpp b/src/main_x11.cpp index 74b162cbec..466ff7b6d2 100644 --- a/src/main_x11.cpp +++ b/src/main_x11.cpp @@ -376,9 +376,13 @@ int main(int argc, char *argv[]) // enforce xcb plugin, unfortunately command line switch has precedence setenv("QT_QPA_PLATFORM", "xcb", true); + // disable highdpi scaling + setenv("QT_ENABLE_HIGHDPI_SCALING", "0", true); + qunsetenv("QT_DEVICE_PIXEL_RATIO"); qunsetenv("QT_SCALE_FACTOR"); - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + qunsetenv("QT_SCREEN_SCALE_FACTORS"); + // KSMServer talks to us directly on DBus. QCoreApplication::setAttribute(Qt::AA_DisableSessionManager); // For sharing thumbnails between our scene graph and qtquick. @@ -393,8 +397,10 @@ int main(int argc, char *argv[]) KWin::ApplicationX11 a(argc, argv); a.setupTranslator(); + // reset QT_QPA_PLATFORM so we don't propagate it to our children (e.g. apps launched from the overview effect) qunsetenv("QT_QPA_PLATFORM"); + qunsetenv("QT_ENABLE_HIGHDPI_SCALING"); KSignalHandler::self()->watchSignal(SIGTERM); KSignalHandler::self()->watchSignal(SIGINT);