QT_SCREEN_SCALE_FACTORS causes pixelated rendering of some QT apps (Telegram, MegaSync...)
I'm using Plasma with hiDPI displays, so I have fractional scaling turned on.
When fractional scaling is on, plasma-workspace sets environment variable QT_SCREEN_SCALE_FACTORS. For some reason this variable causes strange rendering issues with Telegram, MegaSync and some other QT applications.
The only way to remove this variable is to patch startplasma-x11.cpp:
diff --color -ru a/startkde/startplasma-x11.cpp b/startkde/startplasma-x11.cpp
--- a/startkde/startplasma-x11.cpp 2022-08-23 17:55:27.827687762 +0100
+++ b/startkde/startplasma-x11.cpp 2022-08-23 17:56:11.170498094 +0100
@@ -48,7 +48,7 @@
KConfigGroup kscreenGroup = cfg.group("KScreen");
const auto screenScaleFactors = kscreenGroup.readEntry("ScreenScaleFactors", QByteArray());
if (!screenScaleFactors.isEmpty()) {
- qputenv("QT_SCREEN_SCALE_FACTORS", screenScaleFactors);
+ // qputenv("QT_SCREEN_SCALE_FACTORS", screenScaleFactors);
}
I haven't noticed any rendering issues with this variable unset, only improvements.