The DESKTOPINTEGRATION wrapper/environment.d combo only ever stopped the
shadow .desktop/.service self-install. It never addressed a second, worse
symptom: QGuiApplication::setDesktopFileName() in Platform::start() sets the
Wayland app_id to a per-install-path hashed "org.telegram.desktop._<hash>"
id whenever Core::UpdaterDisabled() is false — completely independent of
DESKTOPINTEGRATION — so the running window's app_id never matched our
shipped org.telegram.desktop.desktop and its icon/taskbar entry broke even
after the duplicate launcher file was silenced.
Telegram ships a documented opt-out for exactly this: Launcher::
ComputeExternalUpdater() (core/launcher.cpp) scans <exe-dir>/
externalupdater.d/ for a file containing a line equal to its own full
executable path, and calls SetUpdaterDisabledAtStartup() if found. That one
flag flips both Core::UpdaterDisabled() checks at once — InstallLauncher()
skips the shadow-file self-install AND desktopFileName() uses the plain
"org.telegram.desktop" id that matches our .desktop file, fixing the window
icon too. Drop the wrapper script and environment.d drop-in; back to a
plain /usr/bin symlink plus one externalupdater.d marker file.
The /usr/bin wrapper only stops the shadow .desktop/.service self-install
when Telegram is actually launched through it. A stale GNOME Shell app-grid
entry (or anything else invoking /opt/telegram-desktop/Telegram directly)
still bypasses it and lets InstallLauncher() recreate the shadow files,
which was still reproducing after the previous fix.
Ship a systemd environment.d drop-in setting DESKTOPINTEGRATION=1 for the
whole graphical session, so the guard applies regardless of which launcher
or cached desktop entry starts the binary. Requires a full logout/login (or
reboot) to take effect, same as the desktop-shell cache refresh this bug
already needs on Wayland.
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.
Matching Exec to the real binary path wasn't enough: Telegram also compares
the installed .desktop's DBusActivatable field against what it expects and
still self-installs a shadow copy in ~/.local/share/applications when it
sees DBusActivatable=false, producing the same duplicate-icon symptom.
Setting it to true stops the shadow copy. Bumped release and checksum.
Telegram's own Linux runtime checks whether the installed .desktop file's
Exec matches its actual binary path, and silently writes a private copy to
~/.local/share/applications with a randomized name whenever it doesn't.
Our desktop entry pointed at the /usr/bin/telegram-desktop symlink, which
never matched /opt/telegram-desktop/Telegram, so Telegram regenerated a
shadow launcher on every start, producing a second, unmatched icon.
Exec/TryExec now point directly at the installed binary so Telegram's own
check finds a match. Bumped release and updated the checksum for the
changed desktop file.
libbrotli, libbz2, libfontconfig, libffi, libglib2 and hicolor-icon-theme
don't exist as such in ALT's repos. Verified real names against this
machine's apt-cache: libbrotlicommon/libbrotlidec, bzlib, libfontconfig1,
libffi8, glib2, icon-theme-hicolor.
tsetup.tar.xz bakes in uid/gid 1000 from Telegram's release tooling;
the sandboxed builder can't chown to it, so the build failed with
"Невозможно изменить владельца". --no-same-owner/--no-same-permissions
matches the pineconemc package's handling of the same issue.
Repackages the official static tsetup.7.0.5.tar.xz Linux build for
amd64, keeping the upstream org.telegram.desktop desktop-id and
TelegramDesktop WM class.