Never mistake an entry edited in place for one we generated

A desktop entry that already lives in ~/.local/share/applications is the
user's own file, patched in place with the original kept aside. It used to
get the same X-MCA-Generated marker as a shadow copy, which made the next
scan skip it, fall back to the system entry, and overwrite the user's file
with a shadow - and then delete it on revert instead of restoring it.

The two cases now carry different markers. Only a shadow is skipped by the
scan and deleted when undoing; an entry patched in place stays in the scan
and is restored from its backup.

Also: resolve the applications screen's labels once instead of per row per
keypress, and drop code nothing calls.
This commit is contained in:
Felitendo committed 2026-08-16 19:56:19 +02:00
1 parent d3c82fdff8
commit 5b1fc84710
10 files changed
+63 -60

No files matched your search

+6 -3
View File
@@ -72,9 +72,12 @@ Two ways, chosen per application.
Flatpaks, a copy of the desktop entry with the argument appended is written
to _~/.local/share/applications_, where it shadows the system one. Entries
that already live there - AppImages, web app shortcuts - are edited in
place, with the original kept. Every generated entry is marked with
*X-MCA-Generated*; an entry that is not marked is somebody else's and is
left alone.
place, with the original kept.
A generated entry is marked *X-MCA-Generated* and an entry edited in place
*X-MCA-Patched*. The two are never confused: the first is deleted when
undoing, the second is restored from its backup. An entry with neither
marker belongs to somebody else and is left alone.
Programs that start themselves at login write their own entry into
_~/.config/autostart_ pointing straight at their binary, bypassing the menu