tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Image Preview Off-Screen when using vertical displays

Open mattburchett opened this issue 6 years ago • 17 comments

Steps to reproduce

  1. Have multiple monitors
  2. Configure a display to be a vertical display
  3. Move telegram desktop window to that display
  4. Preview an image.

Expected behaviour

Image preview should show on the display containing the Telegram Desktop application.

Actual behaviour

The telegram desktop client opens the image preview on a different screen than the window is active on, and the image is cut off. If you put it on the horizontal screens, the client works exactly as it's expected to. I can drag the telegram image preview back to the vertical monitor, but it doesn't stay on that screen afterwards. I think this is similar to #5048, but more exclusive to a vertical monitor situation.

Below is a clip of the issue, showing it working fine then once it's dragged to the other screen, it's an issue.

https://youtu.be/bQVJZzUTjHY

Configuration

Operating system:

Arch Linux, MATE Desktop environment (this does NOT happen in KDE. Did not try other environments, but I would likely guess that this can be reproduced on any DE that isn't Qt based.)

Version of Telegram Desktop: 2.1, but also present in the latest available beta version from telegram.org.

Installation source (Linux Only) - the official website / GitHub releases / flatpak / snap / distribution package: Arch Distribution Package (also tried the standalone beta version and same issue)

Used theme: Night Mode, default theme otherwise.

mattburchett avatar Apr 26 '20 09:04 mattburchett

The same bug appears not only on vertical displays, but on non-single display configurations.

I guess that it treats display as something "square", when it doesn't. And current behavior is something like:

  1. Open picture on "primary" display and ignore when telegram app is actually open.
  2. Calculate background size based on display, where main window is shown.
  3. Apply those bounds and center image.
  4. Open image view on primary display with size, calculated for different one.

So final picture looks like this. Green - primary screen, red - secondary with different resolution/size, blue - square - telegram main window, border - image view.

Rectangle-#1

SkeLLLa avatar May 04 '20 11:05 SkeLLLa

this issue is still valid?

Aokromes avatar Jun 04 '20 10:06 Aokromes

@Aokromes yes. It's still present.

And btw, when you switch an image to next or previous it fixes wrong placement.

SkeLLLa avatar Jun 04 '20 10:06 SkeLLLa

Arch Linux, MATE Desktop environment (this does NOT happen in KDE. Did not try other environments, but I would likely guess that this can be reproduced on any DE that isn't Qt based.)

That sounds like the window manager moves the media viewer window

ilya-fedin avatar Jun 08 '20 22:06 ilya-fedin

That sounds like the window manager moves the media viewer window

Yes, that's correct. I guess that telegram calculates dimensions for desktop where window is supposed to be shown, but if DE moves it, then it just didn't recalculate until image is changed.

SkeLLLa avatar Jun 10 '20 14:06 SkeLLLa

Yes, that's correct.

Then it is a window manager issue

ilya-fedin avatar Jun 10 '20 14:06 ilya-fedin

In the case of my original report, it didn't matter if you changed images. It stayed in the same place. It's a misplacement of the media window entirely, but it did it in more than one WM. I have had time to test it with XFCE as well (which uses xfwm instead of Marco/Metacity) and it did the same thing.

It seems to be more related to display placement, though. I had my vertical screens placed (slightly) higher than my horizontal displays (refer to the linked YouTube video) and that triggers the issue. If I put the vertical displays in line with the bottom horizontal display, the issue goes away in any WM. It seems to be an issue with potentially how Xorg handles multiple displays.

mattburchett avatar Jun 10 '20 15:06 mattburchett

If there was a way to check and confirm that it's placed on the same display and location as the Telegram window, that would be ideal, because multi monitor configurations are pretty common nowadays.

mattburchett avatar Jun 10 '20 15:06 mattburchett

Media viewer is created on the same screen where the main window is placed: https://github.com/telegramdesktop/tdesktop/blob/e009ac026d32b39b96899badb71da1350db3457c/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp#L406-L413

ilya-fedin avatar Jun 10 '20 15:06 ilya-fedin

Hey there!

This issue will be automatically closed in 7 days if there would be no activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

stale[bot] avatar Oct 23 '20 15:10 stale[bot]

found similar behavior, I think this is part of the same problem. I am using 2 horizontal monitors with different resolutions

win 10, client version 2.4.7 image

eXqxqxq avatar Nov 13 '20 20:11 eXqxqxq

affects me as well, images and media are shown off-screen on an xrandr-defined 760x1440 virtual screen. Ubuntu 20.04, Regolith/i3wm

mvartanyan avatar Dec 24 '20 10:12 mvartanyan

Is something changed with 2.5.7?

ilya-fedin avatar Jan 29 '21 08:01 ilya-fedin

Same issue with MacOS 10.15.7, also having a vertical screen on my left. Same steps to produce this. This issue occurs on telegram version 2.5.8, Mac App Store's V2.5.1 behaves normally though. I'm using a 4k Monitor as main screen with scaled resolution, and a secondary monitor with native scale and rotated 90 degree vertically.

88545fc0b45ef7ecd38d7-f90900fa3db5e01af5 88545fc0b45ef7ecd38d7-f90900fa3db5e01af5

TheCGCy avatar Feb 07 '21 03:02 TheCGCy

I have similar issue. Browsing media is not possible on monitor in portrait mode. When I move Telegram to main horizontal screen it works fine.

My setup: 2 screens: primary horizontal 2560x1080, secondary vertical 1080x1920. Windows 10 Pro version 10.0.19041 build 19041

https://user-images.githubusercontent.com/54168895/115777281-5e36f480-a3b5-11eb-9da8-8ef15cdd2c46.mp4

Krysiek avatar Apr 22 '21 20:04 Krysiek

Just want to note that comments like "I have similar issue" won't help move the issue forward. Someone who have such hardware should debug this and find the cause to move the issue forward.

ilya-fedin avatar Apr 22 '21 20:04 ilya-fedin

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

stale[bot] avatar Oct 20 '21 00:10 stale[bot]