Telegram as an autostart app results in "unmovable" window

I have Telegram installed as a flatpak (AFAIK there’s no other way), and if I configure it to autostart by making a symlink of /var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop to ~/.config/autostart, it does start with GNOME, but Telegram’s window gets “stuck”: even though it is fully functional, I can’t move it around by dragging its title bar. If I restart it after gnome session is up and running, all works as expected.

Here are the contents of the .desktop file:

[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=telegram-desktop --file-forwarding org.telegram.desktop -- @@u %u @@
Icon=org.telegram.desktop
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
X-GNOME-UsesNotifications=true
X-Flatpak=org.telegram.desktop

Any hints on how to workaround this problem?

As far as I remember, Telegram has the option in settings to start after user logs in. Did you try that ?

1 Like

good memory :wink:
Settings > Advanced > System integration > Launch Telegram when system starts

Mine is Telegram v. 2.2

Yes, I had tried that before making the symlink. It creates another .desktop file on ~/.config/autostart:

[Desktop Entry]
Type=Application
Name=org.telegram.desktop
Exec=flatpak run --command=telegram-desktop org.telegram.desktop -workdir /home/costa/.var/app/org.telegram.desktop/data/TelegramDesktop/ -autostart
X-Flatpak=org.telegram.desktop

But it doesn’t work either :frowning_face: Since it works the second time around, I’m guessing it might be a timing issue?

Hi,

if its a timing issue, could try adding a delay. Append:

X-GNOME-Autostart-Delay=5

Time is in seconds.

Thanks Tom.

1 Like

Nice tip, thanks! One thing that did seem to make a difference was enabling Settings > Advanced > System Integration > Use system window frame which forces it to use GNOME’s windows decorations. Now I can interact with Telegram’s window as expected. Still, there seems to exist some sort of delay for it to fully respond: for the first couple of seconds, clicking on the topbar icon (which still relies on Topicons Fix extension BTW) does nothing. So I guess I’ll combine both solutions (GNOME’s decorations + autostart delay) :wink:

1 Like