QubesOS 4.2.3 Broken Telegram Preview | Fixed!

Intro

For a long time I have been plagued by a QubesOS window management bug and I don’t know how to fix it. I also misdiagnosed the problem in a very old post. To streamline the troubleshooting process, I will create this new post in the hope that someone knows a fix.

The old inaccurate post can be found here: QubesOS 4.1 Multi-Monitor Telegram Preview Issue

Problem 1

Every time I try to open Telegram’s media preview (the pop-up window you get when you click on a video or image), the preview shows a white screen or fragments of Telegram’s main window.

Problem 2

Sometimes the window spawns behind Telegram’s main window, which makes no sense since you want to see what you clicked on. If you toggle through the windows, you come back to the white broken screen problem (problem 1).

What I know so far

  1. The problem has nothing to do with my multi-monitor setup, as I also tested it on my laptop screen without a second monitor attached.
  2. 1 out of 100 times the preview window opens correctly. So it can work, but only once a day with a lot of luck.
  3. It is also not a minimal template problem, as I tested it with the latest Debian-12-XFCE template (and the default telegram-desktop package).
  4. The problem is not new either, as I had the same problem with Qubes 4.1, as you can see from my older post.

My guess

It is not a direct Telegram issue, but a deeper QubesOS window management bug. Any ideas how to fix it?

2 Likes

I just wanted to add a note and tested the Flatpak version. It works!

The previewed image/video jumps up and down a bit until it finds the center, but it works! This confirms my suspicion that the QubesOS window management and the extra margins around the windows somehow break Telegram’s preview.

If I don’t follow up on this thread in the next few days, the fix is to use the Flatpak image!

1 Like

Updated again, it seems to work, but when I scale the interface inside the Telegram app, the preview window is no longer centered, but more down. So the current working solution is to use the Flatpak app and not to change the interface scaling in Telegram’s settings!

1 Like

Last update: I went into Telegram’s advanced settings and selected “Use system window frame”. This makes the Flatpak Telegram window a bit smaller. I scaled the interface up a bit (otherwise I cannot see anything). Now everything in the main window is the way I want it.

The problem now is that the preview window is no longer centered, but the cuts have the images at the bottom (the horizontal center is in the bottom third of the screen now). This makes sense to me, as the assumed screen might be larger to accommodate the interface scaling.

Then I noticed that there is a window expand button in the preview window at the top/right. I pressed it and got an independent window that was centered correctly! Then I clicked it again and got the old preview window back. But now it was centered correctly! So I would assume that the top/right window expansion button basically resets the broken interface scaling properties.

So what you need to do to get Telegram working nicely on your Qubes 4.2.3

  1. Install the Flatpak application (not the telegram-desktop package)
  2. Set the interface scaling to your liking
  3. Check “Use system window frame” in Telegram’s advanced settings
  4. Open the now broken preview window, expand it with the up/right key, close it again.
  5. Enjoy Telegram!

This took me about 3 years to figure out.

To install the Flatpak in a template, run the following commands:

# Add the Flathub repo
http_proxy=http://127.0.0.1:8082 https_proxy=$http_proxy flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# Install Telegram
http_proxy=http://127.0.0.1:8082 https_proxy=$http_proxy flatpak install flathub org.telegram.desktop
3 Likes

I have the same problem after update of flatpak version of telegram.
Thank you for experiments and study of this problem.

I did not get the workaround, though. The problem is with step 4. What do you mean expand it with the up/right key?
When I click any media in chat, it opens window that has jumping content at like 5 Hz scale changing, the window opens maximized.
If I make in not maximized, to some fixed size, jumping stops (layout is still a bit broken, though). When I close it after that, and click on the image in chat again, I have all the same Qubes+Telegram bug.

Unfortunately, I don’t fully remember the issue anymore because Telegram has been working properly on my machine since I posted about it. However, I think I was referring to the button that expands the preview window within the window itself. This is different from the general Qubes window border’s expand feature. It also seems the problem is related to the screen setup. If you have multiple screens, try using only your main screen or a different resolution or frame rate. I hope you get it working!

Unfortunately, none of that helped. When preview is maximized it “jumps” every half of a second. It opens maximized each time. And xfce is a defective DE, does not have any features to manage windows to make it always not-maximized as I would be able to do in KDE.

I have no button inside the window, screen setups did not change the problem, too.

Remember that Telegram is an insecure messenger lacking end‑to‑end encryption and using a spy‑like identifier.

1 Like

I know that, thank you.

The possible half-workaround in xfce is to install devilspie2, write lua rule to unmaximize the media preview video. After that the preview window is a bit misplaced, but at least it does not jump non-stop with 2-5 Hz.