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
+10 -4
View File
@@ -1,6 +1,6 @@
name='telegram-desktop'
version='7.0.5'
release=3
release=4
summary='Official Telegram messaging client'
summary_ru='Официальный клиент мессенджера Telegram'
group='Networking/Instant messaging'
@@ -46,7 +46,7 @@ sources=(
checksums=(
'sha256:37e23ce08333340504623042120b826f7a2a5650c831187219ab9c520740eb42'
'sha256:3a5d621a98f14c34f43474d610ce1c8c7c1849ef21093f9666c2cc6556870682'
'sha256:8ceb3f6aea1003f84f1b5757cd857f8237b294bb18456e5e0e54d96e6fff04ba'
'sha256:3fb1400c7dc9bbc3b5cb3ffedcbf4a9b09c53e28b57a7ff33a8a6b9048864090'
'sha256:f3ad1b5ecdc1c9e5ab3719a0b084a3e0b4fc87ad424fbf81043df9637be3d1f5'
)
@@ -64,8 +64,14 @@ package() {
install -dm755 "${pkgdir}/opt/telegram-desktop"
install -Dm755 "Telegram/Telegram" "${pkgdir}/opt/telegram-desktop/Telegram"
install -dm755 "${pkgdir}/usr/bin"
ln -sfn /opt/telegram-desktop/Telegram "${pkgdir}/usr/bin/telegram-desktop"
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/telegram-desktop" <<'EOF'
#!/bin/sh
# Telegram self-installs a shadow ~/.local/share/applications/*.desktop (and
# a D-Bus service file) on every launch unless this env var is set; see
# InstallLauncher() in Telegram/SourceFiles/platform/linux/specific_linux.cpp.
export DESKTOPINTEGRATION=1
exec /opt/telegram-desktop/Telegram "$@"
EOF
install-desktop org.telegram.desktop.desktop
install -Dm644 telegram-desktop.png \
@@ -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