telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.21k stars 5.2k forks source link

Display scaling bug #28241

Closed apxapob closed 1 week ago

apxapob commented 2 months ago

Steps to reproduce

requirements: 2 monitors with different dpi and resolution.

1) Set different scale factors on your monitors.(I have 200% on main and 125% on secondary) 2) Open telegram window on main monitor. 3) Turn off your main monitor 4) Turn it on.

Result: image

Expected behaviour

I expect telegram to render correctly.

Actual behaviour

image

Operating system

Windows 11

Version of Telegram Desktop

5.3.1

Installation source

Static binary from official website

Crash ID

no

Logs

no
kode54 commented 2 months ago

Similar but different effect happens on Linux desktops with mixed DPI: When toggling off the HiDPI (scale 2.0) monitor, the TDesktop window becomes scale 1.0, then doesn't pick up the scale 2.0 when relocated onto the 2.0 display, either manually by dragging, or automatically by the output restore features of the compositor when the output is momentarily removed.

ilya-fedin commented 3 weeks ago

@apxapob is this still happening with 5.6?

apxapob commented 3 weeks ago

@apxapob is this still happening with 5.6?

yep still happening.

ilya-fedin commented 3 weeks ago

Does it stop happening if you enable system window frame in settings?

apxapob commented 3 weeks ago

Does it stop happening if you enable system window frame in settings?

yeah, happening with system window frame enabled too

ilya-fedin commented 3 weeks ago

Can you reproduce the same issue with qBittorrent?

apxapob commented 3 weeks ago

Can you reproduce the same issue with qBittorrent?

qBittorrent has similar issue. When I turn off the monitor the window goes to the second monitor and has broken layout. And when I turn on the first monitor layout is fine, but it shows everything like it has 100% scaling, not 200%. The ui becomes too small.

ilya-fedin commented 3 weeks ago

Oh, so backporting Qt 6 changes is probably useless given that qBittorent which uses Qt 6 is bugged, too...

ilya-fedin commented 3 weeks ago

Can you check which exactly Qt version qBittorent uses right now (in about dialog)?

apxapob commented 3 weeks ago

Can you check which exactly Qt version qBittorent uses right now (in about dialog)?

Qt: 6.3.0

ilya-fedin commented 3 weeks ago

Qt: 6.3.0

Are you sure your qbittorrent is latest? I see Qt 6.7.3 is mentioned on their website...

Aokromes commented 3 weeks ago

Qt: 6.3.0

Are you sure your qbittorrent is latest? I see Qt 6.7.3 is mentioned on their website...

on latest qbittorrent it's indeed 6.7.3

https://i.imgur.com/7uh8QPu.png

ilya-fedin commented 3 weeks ago

i wonder whether latest qbittorrent bugs

apxapob commented 3 weeks ago

Updated qbittorrent. The same situation on Qt 6.7.3

ilya-fedin commented 3 weeks ago

ok, thanks

ilya-fedin commented 3 weeks ago

Does this happen with 5.6.1?

apxapob commented 3 weeks ago

I don't know. Where can I check that?

ilya-fedin commented 3 weeks ago

I don't know. Where can I check that?

I don't quite understand the question. How did you check previously?

apxapob commented 3 weeks ago

oh sorry. I thought I need to find an app with Qt 5.6.1 In telegram 5.6.1 the bug still happens.

ilya-fedin commented 3 weeks ago

What do you do to get out of this state? Does resizing window help? Does moving the window a little bit (the relevant event should be sent on mouse button release) help? Does changing Windows settings (e.g. enabling/disabling dark mode) and then moving the window a little bit help?

apxapob commented 3 weeks ago

I usually just restart telegram. Also I can fix it by changing screen scale factor. Anything else doesn't help.

ilya-fedin commented 3 weeks ago

Anything else doesn't help.

None of the things I suggested to try?

apxapob commented 3 weeks ago

Yeah.

ilya-fedin commented 3 weeks ago

Hm. I wonder whether the relevant message is sent only with native titlebar. Can you try moving the window with it?

An important thing is to try switch the system dark mode if just moving doesn't work as it sends the event that forces Qt to update its screen list (and then on the end of window move Qt should update window's associated screen).

apxapob commented 3 weeks ago

Tried that. Didn't help.

ilya-fedin commented 2 weeks ago

Does this happen with 5.6.2?

apxapob commented 2 weeks ago

This is funny. Telegram 5.6.2 crashes when I turn the monitor on. Which is better because I don't have to shut it down by myself=)

ilya-fedin commented 2 weeks ago

Can you provide crash id of the crash report (you have to enable beta installation in settings for crash reporter to appear, DON'T wait for an update)?

apxapob commented 2 weeks ago

Crash ID: 3c7ec04c-7038-4481-9c8d-1ba3b03086c3

ilya-fedin commented 2 weeks ago

Can you re-test the bug when you will get 5.6.3?

apxapob commented 2 weeks ago

yeah sure

apxapob commented 1 week ago

Yay! I checked 5.6.3 - The bug is finally fixed!