fix(telegram-desktop): actually stop the shadow desktop-file self-install

The Exec-path and DBusActivatable matching from the previous two commits
were treating the wrong cause: InstallLauncher() in tdesktop's
specific_linux.cpp unconditionally wipes and rewrites its own
~/.local/share/applications/*.desktop and dbus-1/services/*.service on
every launch, regardless of what the installed .desktop file says — unless
the DESKTOPINTEGRATION env var is non-empty, which is upstream's documented
opt-out for exactly this kind of repack.

/usr/bin/telegram-desktop is now a wrapper script that sets
DESKTOPINTEGRATION=1 before exec'ing the real binary, covering every launch
path (desktop file, D-Bus activation, terminal). The .desktop file's
Exec/TryExec/DBusActivatable revert to their original values since the
field-matching theory they were built on didn't hold.
This commit is contained in:
Александр
2026-07-25 16:11:20 +10:00
parent f33ec4b124
commit b9e2887b2f
2 changed files with 14 additions and 8 deletions
@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Telegram
Comment=New era of messaging
TryExec=/opt/telegram-desktop/Telegram
Exec=/opt/telegram-desktop/Telegram -- %U
TryExec=telegram-desktop
Exec=telegram-desktop -- %U
Icon=org.telegram.desktop
Terminal=false
StartupWMClass=TelegramDesktop
@@ -11,12 +11,12 @@ Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;x-scheme-handler/tonsite;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
Actions=quit;
DBusActivatable=true
DBusActivatable=false
SingleMainWindow=true
X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true
[Desktop Action quit]
Exec=/opt/telegram-desktop/Telegram -quit
Exec=telegram-desktop -quit
Name=Quit Telegram
Icon=application-exit