Open MaxMatti opened 1 year ago
Relevant issue in the KDE issue tracker: https://bugs.kde.org/show_bug.cgi?id=471443 It also contains links to the respective issues in the Telegram and Qt issue trackers.
So AFAIK this is an upstream issue that we have little control over?
It's an upstream issue that NixOS is able to provide a workaround for until it's fixed upstream.
Would this break the scaling for others (who do rely on QT_SCREEN_SCALE_FACTORS)?
This will break scaling in any Qt application started by tdesktop itself (be it okular when clicking on a pdf file or KDE settings when clicking 'Open system settings' button in the tdesktop call settings). That's why I ended up with a Qt patch in tdesktop upstream, that's just completely broken by both Qt and KDE.
Actually, you can make KDE use the proper APIs for scaling by setting DPI in font settings instead of global scaling in monitor settings (use 96 * your scale factor). But this will make the scaling worse for KDE applications as scaling in Qt 5 is opt-in and KDE rarely opts-in to it in their applications, apparently due to that hack with environment variables which makes the problem hidden.
TL;DR use Wayland if you want non-buggy scaling on KDE. Every other way will lead to noticeable bugs.
Same issues when using Gnome with Wayland when enabling Enable precise High DPI scaling
in Telegram's Experimental settings.
If you don't turn this option on, telegram seems to downsample after rendering at an integer multiple, which can lead to a certain degree of blurring.
If this option is not turned on, telegram will show that it is displaying at 200% interface scale and display correctly at the scale factor set by my display (150%).
After turning this option on, telegram will show that it is scaled to the scaling factor of my display and the text is noticeably clearer.
So I guess this option is turned on whether to set the fractional scale factor or use downsampling.
Yeah, QT_SCREEN_SCALE_FACTORS that is set by KDE forces Qt to always act like this option is turned on.
Yeah, QT_SCREEN_SCALE_FACTORS that is set by KDE forces Qt to always act like this option is turned on.
However, if this option is not turned on, the fonts will indeed become blurry (even on my 4k display), Although not obvious. I guess it is because downsampling will cause sub-pixel rendering to completely invalid. It may be necessary to wait for qt and telegram to support wp-fractional-scale-v1 before this problem can be truly solved.
Qt supports it. But Telegram is a legacy application in terms of HiDPI: it was developed in 2013, long before Qt got HiDPI support and is not compatible with Qt's HiDPI. At that point Telegram has thousands of lines of code implementing widgets and all these lines have to be rewritten to support fractional scaling and runtime scaling changes. It's clear this is not going to happen so if you need native fractional scaling support then you better trash tdesktop out and use something other e.g. Telegram Electron. tdesktop is likely to forever be blurry on other than integer scaling factors, support only one screen scaling (unless Qt gets in the way and rescales with ruining picture quality) and not to have support for runtime scale factor changes (again unless Qt gets in the way).
Describe the bug
Icons in Telegram Desktop pixelated when using display scaling in KDE
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
high-res icons used
Screenshots
Additional context
Starting Telegram by running
QT_SCREEN_SCALE_FACTORS='' telegram-desktop
in a terminal fixes this. Not sure if putting that into the .desktop-file is your preferred fix or just a workaround. By default the variable is set toeDP-1=1.5;HDMI-1=1.5;DP-1=1.5;DP-2=1.5;DP-3=1.5;DP-4=1.5;DP-5=1.5;
on my system, likely by KDE.Notify maintainers
@NickCao
Metadata