Tdesktop: Auto DPI scaling

Created on 23 Sep 2015  ยท  115Comments  ยท  Source: telegramdesktop/tdesktop

Would it be possible to allow the app to automatically change the DPI scaling at runtime depending on which screen it is in?

This is an issue in multi-screen environments with different DPI scaling per screen.

Is this some limitation of Qt?

enhancement ui

Most helpful comment

Revese operation is also a problem.
When moving telegram app from HDPI screen with with default scale (i.e laptop build in display) to external FHD monitor app is HUGE.
So .. 5 years passed since this bug opening and this is still an issue ? This is good contender for longest bug open.

All 115 comments

I can confirm this on my _DELL XPS 15_ (monitor 3K + external ultrawide monitor)

XPS Display
image

External Monitor (see near it for comparizon: there's a normal explorer window).
image

I still have this issue with last version (even reinstall didn't worked). There's no auto DPI scaling.

@auchri this is still not working for me (even with the last update)

@ssorokin I confirm.
No response from @telegramdesktop or @auchri or even from @john-preston ... this is a bug and need fix. Maybe there's something more "urgent" right now ๐Ÿ˜Ÿ .

I had configured the repo for working on the code and may spot the bug but i have to admit that i haven't had much time to work on it ๐Ÿšถ

@PaoloFalomo @telegramdesktop can't respond, because it is an organization account now ๐Ÿ˜Œ

This is not something that can be changed any easy way: all the styles are configured when the app is launched according to the current interface scale level chosen in Settings (which is chosen by the current dpi), so at this time there is no way to change the interface scale factor in runtime.

@john-preston Oh! Ok ๐Ÿ˜ธ for the telegramdesktop user, thx for the info eheh.

Btw i had a similar problem about this developing other win apps.

I think it should all be DPI-AWARE. So it may needs to rewrite a tons of lines of code ? ๐Ÿ˜ฎ

@PaoloFalomo Yes, Qt sets DPI awareness as per-monitor by default. I guess currently I need to set it to system DPI aware.

Is there any update on fixing this issue? It has made Telegram desktop rather unusable for me. Which is a shame as it's otherwise fantastic.

Also, can we get 175% scaling or adjustable font size? Right now there are only 150% and 200%.

My primary monitor is 100% scaling and my laptop is 250%. Need to be able to scale based on monitor it's currently on. I like to use my laptop for chat and my monitor for work but I can't right now.

Love nearly every aspect of Telegram. But this is actually very annoying.
Though running with the web-version in a browser solves it temporary. But then the notifications and stuff is not as good.
+1 on this!

Qt does support setting DPI awareness to "System Aware" instead of "Per Monitor Aware" by setting DPI bit in platform configuration. I guess another Qt patch for Telegram Desktop would be okay to address issues with multiple displays and DPIs since adapting Per Monitor Aware (even Per Monitor Aware v2 introduced in Windows 10 Version 1703) is hard.

Ok but for example i use 3 monitors each one with very different dpis and i need to move chat on other monitor.

Telegram is the best free chat platform as slack for me... I love the new call feature just tested last week with my father ๐Ÿ˜

But...

Even whatsapp currently works on multi-monitor so telegram need this to be fixed.
I am a developer and i'd investigate my own to debug this but i've no time at moment :(

@imbushuo that link doesnt mention anything about linux, do you know about the state of things in linux?

Is there any updates on this issue? I have bought laptop with HiDPI screen to save my eyes.
And guess what? Telegram at maximum scale is almost unusable for me now :(

@semka i can confirm. This is still an issue since 2015 ๐Ÿ˜ข

@matti I don't know the platform-specific configuration of Qt on Linux. Sorry.

Screenshot (4).png

So at least Telegram modified DPI awareness on Windows to "System Aware" to enable Windows scale it on display with different DPI (in my case, an alternative display at 100%) in the latest update.

+1. Fonts and scrollbar are really tiny with scaling 200 on a 4k display (at 13").
A scaling factor 300 (or 250) would probably solve this.
With Microsofts Creator Update 4k displays will get more and more common this year I guess.

When I disconnect my external display, all the images and icons get blurry. I need to restart the app to solve temporarily the problem.

  • Telegram Desktop v1.1.7
  • macOS Sierra v10.12.5

3 days more and it will be one year since my last comment here

@PaoloFalomo and what?

@stek29 It will be my buggyversary.

_since i had posted here i have moved to mac os with no problems of dpi scaling between monitors_

How can this not be fixed since so many years?
This days all top laptops are 3k, 4k. But we still have our old FHD monitors (why switch them, rigth?).
So why is it so hard to fix this one?

@stgolem Because this is just hard in current implementation :( All the layout and graphics are set up for current scale factor on the app launch and can't be changed in realtime right now.

Is this also an issue on Ubuntu?
Can we create alternative Electron app from web client to solve this issue?

@stgolem This is an issue for Telegram Desktop on all platforms. Yes, you can create an alternative app for that.

@john-preston How hard would adding 250-350% manual scaling in the settings be? That would make it usable on very high dpi displays when the main display is FHD.

I need 400% scaling on MacOS. 250% was not enough for me. I finally have a Retina MacBook Pro but now I can't use my favorite app due to some irrational disablement of a key feature. I'm very sad.

Can we at least get more fixed scale factors available? I'm struggling with it right now, because 150 is too small, and 200 is too large for me on 27 4k. At least give us 175% and >200% for those laptop users.

Here @imbushuo showed a screenshot with Telegram running as a "System aware" application on Windows 10.
I have Telegram version 1.2.6 and Windows 10 1709, but Telegram is reported by Process Explorer as a "Per-Monitor Aware" application.
Because of this and the fact that Telegram is not actually per-monitor aware, in a multi-monitor setup using a HiDPI device (Surface Pro 3) and a Full HD 24'' external monitor, the Telegram window content is either too small or too big when the window is moved from one monitor to the other.

Using the executable properties to set its scaling management to "System" allows to show the application with proper size in both screens, but by doing so, the app is blurred on the HiDPI screen. Moreover, when the PC is not attached to the external screen, the application is blurred anyway.

A viable solution would be to make Telegram a "System aware" application again, so that the application would be seen correctly on the "main/only screen" (as selected from Windows settings), and scaled by the OS on the other screens (with the associated blurriness).
I think this should be relatively easy to do by changing the qt.conf file as explained on the official Qt documentation, in the Windows section.

I am using the Telegram Desktop Client on Linux and I can scale it via Settings --> Interface Scale

Telegram-desktop is too small on 13" 4K screen. It correctly detects it's a hidpi screen and sets scaling factor to 200%, but I'd prefer 250% or 300%.
I've managed to make it larger by setting up the QT_SCALE_FACTOR environmental variable to 3, but then when I select any chat, app will freeze and become unusable.
I'm using latest telegram-desktop on Fedora 27 linux.

It's been over 2,5 years since this problem was first brought up. Is there any sign of the devs working on a scaling option over 200 % ?

Save my eyes!

This is how it works at Everdo for Windows PC (seems it based on Qt):
everdo zoom ui

Please fix this! I'm using Dell XPS 13 (9370) with 4k display. The display seems to small without 300% scale option

I love the Telegram so much but I struggle for every day I connect my laptop to different displays with different DPI. Could we at least apply a patch which will restart Telegram when it was moved to another display ? Is it possible ? For now I restart it manually each time I disconnect laptop from dock station. Very annoying... Thank you guys!

Would be nice if telegram could recognize multi dpi evironments. Every other QT5 App does that out of the box with QT_AUTO_SCREEN_SCALE_FACTOR=1 environment variabel - so telegram is somehow activly disabling that.

EDIT: the code is here
https://github.com/telegramdesktop/tdesktop/blob/c7a4d67cfb63af74f6da6ca35aea9ad08cf65588/Telegram/SourceFiles/core/launcher.cpp#L41

The font on Dell 4k 13xps is just too small. Please make an option to scale up to 300% or more.

I have this issue on win10 switching between 4k and convential dpi monitor. I have to manually adjust the "interface scale" every time since auto has no effect.

Please update the Software to allow higher scale 300% or more. I have a new HP Spectre 360 with 15" 4 K Display and can barley read telegram messages with my best glasses on. Very difficult to use.

Same here. Interface is too small even on cheap Lenovo 720S with 4k screen. There are lots of Windows laptops with 4k screens now.

Same with my Macbook Pro, save my eyes!

I'd like to confirm it's still the issue for me. My configuration is

the Windows client 1.3.14 on Windows 10,
a WQHD 14'' internal screen with the 175% system scaling factor and the 150% scaling factor set in Telegram,
an FHD 24'' external screen with the 100% scaling factor.
The client is rendered usable on the internal screen (though I'd appreciate a bit larger fonts with the same size interface elements so the font size setting would be handy here too) but when I move its window to the external screen, it's shown too large.

That's the annoying issue especially given most of the other applications which are being actively developed do not suffer from it. Hopefully, we'll get a fix for it.

P.S. Otherwise, the Telegram client is great. )

JFYI, I've managed to add 250% and 300% scales support to Telegram client, anyone interested could check it in my hdpi branch. Emoji and icon set images are just upscaled 200% ones, but it's still a way better than tiny letters at 200% on my Dell XPS 13.

@3cky
I looked at your code and it seems good. It will be very nice if you make a pool-request!
Those who want to build from the source code will clearly not be so much, but if the contributing will be accepted, then all of us would thank you.

And apparently, the developers don't care about this issue a lot. (3 years passed by)

@lucidyan
I'm not quite sure that developers are interested in code since it's rather trivial. Here @john-preston wrote that 250%+ scaling support adding problem is in graphics. Upscaled 200% graphics looks very decent to me, but it seem the Telegram team don't like it, so here we are.

@3cky maybe it's because 250% may make images blurry. Maybe it would be better to scale 100%, 200%, 300% and 400% only to force pixel on images be drawn as squares with side 1, 2, 3 and 4 pixels.

@3cky could you please also build it for me? or even create a telegram group when you will send new releases with hdpi support =) that would be awesome

I`d like to share what worked for me! (EDIT: actually I get some blur on high dpi screen, while the interface autoscale correctly)

I followed the advise from this article and then restarted telegram (edit: its settings "interface scale" is disabled)

how-improve-app-dpi-scaling-enabling-system-enhanced-feature-windows-10

@igordata nice idea, I've uploaded patched 1.3.14 binary for Linux 64 bit to this Telegram channel. Don't have Windows machine with Visual Studio installed at hand, so no Windows build for now, sorry.

Got a Windows box and built patched 1.3.14 binary, please check it out here.

Any chance of getting an official fix?
It's been 3 years since the issue was opened, makes Telegram Desktop unusable for me

UPD: Latest beta looks awesome!

Thanks @3cky I've tried it locally and both 250% and 300% scales work fine on my Dell XPS 13 with 4K resolution. I hope this fix will get included in the official release.

As reported in my original issue #4586 my 13" screen has 4K resolution (not sure why, 3200x1800 was perfectly adequate, but in latest xps model dell has increased it to 4K) so 200% scale factor is not enough - text is too small and hard too read in chats. The above fix allowing me to set scaling to 250% or 300% is a massive usability improvement.

are you using latest version? there should be 250% factor built-in afaik. (without any half-done patches)

are you using latest version? there should be 250% factor built-in afaik. (without any half-done patches)

I'm using the most recent version, and it does not even have proper support for 125%. It just asked for an update, so I'm sure it's the latest beta version

2018-12-06_08-36-22
firefox_2018-12-06_08-36-49

Here's another screenshot on the secondary display without scaling:

telegram_2018-12-06_08-37-56

As you can see there, the font size of this issue, rendered in the latest Firefox, is nearly equal on the secondary display, while everything looks too small on the other screen

@NicoHaase You can change the scale level in Settings.

@NicoHaase You can change the scale level in Settings.

Yeah, I've just found that setting and experimented: when setting the interface scaling to 125%, everything looks okay on the larger display (with scaling set to 125% in the Windows screen settings), while everything is too large on the secondary display - obviously: the app is now scaled to 125% on that screen too.

I can confirm, that on Linux build version 1.5.1 I can see added scalling options for non HiDPI screens, so 100%, 125%, 150%, 200%, 250%, 300%; and I can see scalling options on laptop with a HiDPI screen: 100%, 110%, 120%, 130%, 140%, 150%. ๐Ÿ‘

This was reported in 2015. The correct tag of this would be "bug" not enhancement, as this is incorrect behavior on monitors with separate scaling. It would also make this the most commented bug, at 65 comments.

Just would like to suggest some focus on this one, 4k screens in laptops aren't going away.

@DropsOfSerenity 4K screen should work fine if this is the only screen. If you drag the app between different screens with different DPIs tdesktop will not rescale :(

This still happens in Telegram Desktop 1.5.4. I currently have two instances of Telegram Desktop installed with different scaling options to circumvent this issue, it is really annoying. I would hope that after more than three years this issue could be fixed :(.

is this issue being ignored?

This is actually the only desktop app I use that doesn't automatically change the scaling when I move it to another monitor on Windows 10. We need this!

Agree, ran into this issue just now. Moving the telegram app to a high DPI screen results in a really small UI.

Guys, could you add "at least" an option to tray icon context menu "Restart". For now after moving telegram from one display to another I have to restart it manually - go to context menu, click Quit, open Start menu, find Telegram, click it to run. Very annoying. Adding at least "restart" option will be a quick workaround for the issue until you will be able to find a fix.

Guys, could you add "at least" an option to tray icon context menu "Restart".

After updates there is a button at the left down corner of the window. It does the restart.

Anyway, we here in this issue are complaining about the DPI problem. :D You should create your own issue.

@3cky since a lot of people asks, you may add to that commit of your 175% and 75% scaling and make a pull request for it? :)

So what about auto scaling?

Also an issue for me. A quick way to restart it upon monitor change would be really appreciated.

We need to create breaking solution for it by users community. Maybe, you should announce a bit crowdsourcing for this issue to some Telegram channels. It could be big idea, someone (with strong design and webdev skills) would help us. ๐Ÿ™

+1

+1

is it fixed? problem still exist..

Still a big annoyance for me

+1

Issue still exists. Kinda silly after all this time, isn't it?

Yeah, it looks like that. I have been suffering from this issue over a year, my setup is a laptop with a HighDPI screen and an external monitor with the standard DPI. Whenever I move the Telegram client's window from the HighDPI screen to the other one, it becomes ridiculously large.

I guess most of Telegram's developers use laptops from Apple and are not motivated enough to fix the issue for users on Windows. That's a bit shocking given WhatsApp and Slack seem to be free from the issue, as well as most of other up-to-date programs. This behavior of the Telegram client on Windows contradicts to the reputation of Telegram as an innovative company living on the cutting edge.

Four years later and this is still a problem? I just upgraded my monitor today and opened up telegram and WHAM everything is shrunken and virtually unreadable. Huge annoyance and something that would prevent me from using it further, as I already have eye strain issues.

@JonMcDevitt You can choose interface scale in Settings.

@john-preston it's not dynamic, it doesn't change when you drag it from one screen to another (with different scaling). It's not a solution for this problem.

I wanted to say Byebye to Whatsapp and welcome to Telegram..
But the scaling is horrible. Please take care of autoscaling and we all happy

I have found a workaround by setting the High DPI scaling override in windows to System for the telegram.exe. This makes the desktop app usable again.

https://blogs.windows.com/windowsdeveloper/2017/05/19/improving-high-dpi-experience-gdi-based-desktop-apps/

@bernikr
You are my hero! Only issue i found is that the rightclick does not work propper (e.g. Achiving chats)
But i can live with it

I have found a workaround by setting the High DPI scaling override in windows to System for the telegram.exe. This makes the desktop app usable again.

https://blogs.windows.com/windowsdeveloper/2017/05/19/improving-high-dpi-experience-gdi-based-desktop-apps/

It cannot be applied to the UWP app. Also, it makes the app look blurry on the desktop version.

Wow this is a very long issue thread with many duplicates! (Ahem there's probably a reason for that)

I actually had 175% working when I first installed Telegram and things looked great on my high-DPI 3K laptop screen... But for whatever reason, the option disappeared again in the latest version, leaving me stuck on 150% which is absolutely tiny and barely readable on a super high resolution 12" laptop display!

Additionally the fact that Telegram can't auto-scale in a multi-monitor setup is highly annoying, especially when Discord does this flawlessly. I understand the issue that all the assets are pre-rendered when the app is launched and can't be re-rendered during runtime, however:

  1. How about just... don't do that, yeah?
  2. We aren't exactly living in Amiga days anymore, I think my hexa-core gaming laptop processor can handle rendering a few SVG's at 32x32 pixels, heck it could probably re-render the whole app 60 times a second with no cache at all (if you're crazy like that). I mean the web is a perfect example. Despite the best efforts of efficient web engines, website elements and content often must be constantly re-rendered in real time an EXTREMELY inefficient manner, and yet even most interactive page elements (without using Canvas or hardware acceleration like an HTML5 game would) often run with virtually no lag on a modern smartphone. Kind of a testament to how powerful our modern devices are compared to where we began, I think we can handle a little code inefficiency for the sake of real-time UI scaling.
  3. Okay back to the first point but serious this time, regardless of how complex a change it might be, if you had started gradually working on fixing this when this thread was CREATED it probably would have been done by now. Even if there is some kind of limitation in Qt, just use a Winapi hook to detect the DPI of whatever screen the app is moved to.

Revese operation is also a problem.
When moving telegram app from HDPI screen with with default scale (i.e laptop build in display) to external FHD monitor app is HUGE.
So .. 5 years passed since this bug opening and this is still an issue ? This is good contender for longest bug open.

@MrSpock As first commenter i can say the struggle is real but had solved my issue buying a mac.

I'm currently using a 2k screen with 175% DPI on Windows and 125% looks tool small while 200% seems to be too large. Is Telegram still having plan to add support for 175% scale?

I'm currently using a 2k screen with 175% DPI on Windows and 125% looks tool small while 200% seems to be too large. Is Telegram still having plan to add support for 175% scale?

you can use command line to set 175%

I'm currently using a 2k screen with 175% DPI on Windows and 125% looks tool small while 200% seems to be too large. Is Telegram still having plan to add support for 175% scale?

you can use command line to set 175%

How do I do that on windows?

This may be relevant/helpful https://bugreports.qt.io/browse/QTBUG-48242

This may be relevant/helpful

tdesktop uses custom scaling engine, as @john-preston stated, i.e. implementing this request means rewriting a big part of the app :(

Probably that's why this request isn't implemented in 5 years and I have a feel that it won't be implemented in another 5 years (maybe only in a new client xD)

Why is the client using a custom scaling engine? I assume the desktop app was written before the scaling feature was built into the qt backend?

@Dimensional Yes. Also it allowed to have different scalings on the same screen dpi that you can just choose in Settings. Different people use different scale factor on the same screens.

Hello!

Same problem here.
I have dell XPS 15" 4k + external fullHD display.
OS Windows 10.
Default scale 250%

There is a problem with scaling when you move app from one display to another.
The same problem with dock icon.

It will be nice to fix this 4 years old bug.

Thank you.

It will be nice to fix this 4 years old bug.

It will be nice if you read at least last messages in the thread ๐Ÿ˜’

Hello!

Same problem here.
I have dell XPS 15" 4k + external fullHD display.
OS Windows 10.
Default scale 250%

There is a problem with scaling when you move app from one display to another.
The same problem with dock icon.

It will be nice to fix this 4 years old bug.

Thank you.

Same problem. I run a 3-monitor setup (almost just like @PaoloFalomo , 1 4K 120Hz, 1 FHD 240Hz and 1 2K 144Hz Vertical) and going into the Telegram.exe -> properties -> compatibility -> high dpi scaling and setting it to system or system(enhanced) fixed it, but it looks super low res in the 4K one, although it looks well in the FHD one and fine on the 2K one. I seriously can't believe that the original post is from 5 years ago and this feature still hasn't been implemented. If the team had begun working on this on the side when it was posted, it probably would be done by now.
I'm aware this is a big change, but it's something to be expected from the 'innovators' in the market.

I โ€œfixedโ€ that by using another client โ€œUnigramโ€

Seems I found work around.
Watch screenshot
image

Seems I found work around.
Watch screenshot
image

This seems to "address" the issue for me. This is an OK workaround.

Seems I found work around.
Watch screenshot
image

This doesn't work when you drag tdesktop window to different dpi monitor. So, step number 1 does nothing.

This doesn't work when you drag tdesktop window to different dpi monitor. So, step number 1 does nothing.

Hmm...
In my case all is ok.
I have laptop with 4k and external fullHD monitor.
I tested this workaround several times before posting.

This doesn't work when you drag tdesktop window to different dpi monitor. So, step number 1 does nothing.

Hmm...
In my case all is ok.
I have laptop with 4k and external fullHD monitor.
I tested this workaround several times before posting.

Do you use store or regular installation of tdesktop? It doesn't work for store one, at least. Changing compatibility settings of C:\Program Files\WindowsApps\TelegramMessengerLLP.TelegramDesktop_2.2.0.0_x64__***\Telegram.exe does nothing. The same setup: 4k surface + 1080p monitor.

This doesn't work when you drag tdesktop window to different dpi monitor. So, step number 1 does nothing.

Hmm...
In my case all is ok.
I have laptop with 4k and external fullHD monitor.
I tested this workaround several times before posting.

Do you use store or regular installation of tdesktop? It doesn't work for store one, at least. Changing compatibility settings of C:\Program Files\WindowsApps\TelegramMessengerLLP.TelegramDesktop_2.2.0.0_x64__***\Telegram.exe does nothing. The same setup: 4k surface + 1080p monitor.

I'm using regular installation.
I changed settings of C:\Users\user_name\AppData\Roaming\Telegram Desktop\Telegram.exe

This doesn't work when you drag tdesktop window to different dpi monitor. So, step number 1 does nothing.

Hmm...
In my case all is ok.
I have laptop with 4k and external fullHD monitor.
I tested this workaround several times before posting.

Do you use store or regular installation of tdesktop? It doesn't work for store one, at least. Changing compatibility settings of C:\Program Files\WindowsApps\TelegramMessengerLLP.TelegramDesktop_2.2.0.0_x64__***\Telegram.exe does nothing. The same setup: 4k surface + 1080p monitor.

Hello. You need quit Telegram, not just close it. I tested this fix today, Windows 10 [Version 10.0.19042.630], Main screen Full HD, Second screen External 4k UHD via USB-C, and it works. Just go into system tray and QUIT Telegram and start it again.

You can't do such a necessary thing in 5 years! Amazing!
For the scaling support, I'm ready with happiness to replace your app to Electron version.

@Voljka1 Do you use store or regular installation of tdesktop?

@Voljka1 Do you use store or regular installation of tdesktop?

I am using regular installation.

That's a shame. The oldest bug and laziest devs I've ever seen.

for many years, this still a bug ๐Ÿ˜…

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slowaways picture slowaways  ยท  3Comments

matteotumiati picture matteotumiati  ยท  3Comments

ghost picture ghost  ยท  3Comments

FunctionalHacker picture FunctionalHacker  ยท  3Comments

Liudvikas picture Liudvikas  ยท  3Comments