Cache cleaning and Launcher bugfix#249
Conversation
… packaging scripts
…pace pruning logic
…app and instance IDs
…mproved Linux instance handling
|
@avifenesh I found an issue with multiple instances when launching from the app's context menu, and I'm still trying to get it working. If you can help me test whether it's possible to launch several instances from this context menu, that would be very helpful. I'm not quite sure whether the bug comes from COSMIC or from the .desktop Exec statement. |
|
@Leay15 i opened a pr for cleaning up orphan py proc, might be that? |
…ktop` for consistency
|
@avifenesh I'm not quite sure, but I think it might be related, though not the root cause. I tested this build after a clean system restart, and it still doesn't work, but a normal launch works as expected. So I don't think it's related to an orphaned py proc. |
|
Can you explain exactly the behavior, and maybe some logs? |
|
@Leay15 this may be a stale desktop-entry precedence issue rather than the The split you described makes sense if the app grid/launcher is using On my machine I found exactly that kind of stale local entry: grep -Hn "^Exec=\|^Actions=\|^\[Desktop Action" \
~/.local/share/applications/codex-desktop.desktop \
/usr/share/applications/codex-desktop.desktopThe local file had an older action/Exec, so a launcher menu could execute the wrong command even though the packaged A quick way to test this theory is to temporarily move the user-local file aside and refresh the desktop DB/cache: mv ~/.local/share/applications/codex-desktop.desktop \
~/.local/share/applications/codex-desktop.desktop.bak
update-desktop-database ~/.local/share/applications 2>/dev/null || true
update-desktop-database /usr/share/applications 2>/dev/null || trueThen reopen the launcher and try |
|
@Leay15 one more follow-up: I think we can make this defensible/idempotent instead of leaving it as “users may need to delete a stale file”. First, one repro detail: on Linux, pressing For the stale desktop-entry case, I’d split the fix like this:
That would turn this class of bug into an idempotent migration instead of a one-off support instruction. A small |
|
One more thing I just checked: the duplicate Ubuntu Dock adds its own synthetic const actions = appInfo.list_actions();
if (app.can_open_new_window() && actions.indexOf('new-window') === -1) {
// add synthetic "New Window"
}So action ids like I think the upstreamable fix is to use the conventional desktop action id everywhere: Actions=new-window;CheckForUpdates;InstallReadyUpdate;
[Desktop Action new-window]
Name=New Window
Exec=env BAMF_DESKTOP_FILE_HINT=/usr/share/applications/codex-desktop.desktop CHROME_DESKTOP=codex-desktop.desktop CODEX_MULTI_LAUNCH=1 /usr/bin/codex-desktop --new-instanceAnd mirror that for the user-local/AppImage templates. The user-facing label can still be |
|
@avifenesh thank you so much for that follow up Let me check all points and perform the modifications I will let you know 👌🏻 |
…repairing .desktop files on Linux
… entries based on `$PACKAGE_NAME`
…te repair logic for shadow entries
…r desktop entry handling logic
…ctor.sh` and refine desktop entry repair logic
…e `.desktop` actions to `new-window`


This pull request closes #243.
It includes a fix for workspace cleanup and updates the
codex-update-managerversion. Also itintroduces several improvements to Linux desktop integration, focusing on multi-instance support, launch actions, and window state handling. The most important changes are summarized below:
Update Manager:
codex-update-managernow prunes unreferenced updater workspaces and removes heavy build artifacts, preserving only diagnostics and reports.codex-update-managercrate version to0.8.1.Linux Desktop Integration Improvements:
.desktopfiles (codex-desktop.desktop) for both user-local and system packaging, allowing users to launch multiple Codex instances easily. This includes the necessary environment variables to support multi-instance launching.package-common.sh) to reliably inject the new "NewInstance" action and ensure correct desktop file rendering for both updater-enabled and standalone builds.Launch Action Infrastructure:
CODEX_LINUX_INSTANCE_IDand other environment variables, improving robustness.Window State Handling:
applyLinuxReadyToShowWindowStatePatch) that ensures maximized window state is only restored on Linux if the window was previously maximized, preventing unwanted maximize behavior. This patch is integrated into the patch system and tested.