Skip to content

fix(electron): don't write a second Linux launcher for the AppImage - #7140

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-7139
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-7139

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

After updating to v0.26.0-rc15, a Fedora tester saw GAIA twice in the app grid: the AppImage wrote its own launcher next to one an AppImage tool (or the user) had already made. Now, before writing, GAIA looks for another launcher that runs the same AppImage. If it finds one, it writes nothing and removes the duplicate it wrote earlier, so the grid shows one GAIA with no manual cleanup. It never touches a launcher it didn't write.

Closes #7139

Test plan

  • cd tests/electron && npx jest passes (61 suites, including 5 new launcher cases)
  • python util/lint.py --all passes. It currently fails on mypy, import-validation and tool-description errors in Python files this PR doesn't touch.
  • python -m pytest tests/unit/ -x. Not run here because the runner had no pytest, and this PR changes no Python.
  • On Fedora with AppImageLauncher or Gear Lever, plus a leftover gaia-desktop.desktop from rc15: launch the new build. ls ~/.local/share/applications | grep -i gaia should show only the tool's entry, and the grid should show GAIA once.
  • On a clean Fedora with no other GAIA launcher: launch the AppImage. gaia-desktop.desktop should still be written, and the window should show GAIA's name and icon.

⚠️ Needs manual validation: Jest covers the file logic, but it can't show what GNOME displays. A maintainer should run the two Fedora checks above (together with #7138) before merging.

🔍 Technical details
  • installAppImageLauncher() in services/appimage-launcher.cjs checked only for gaia-desktop.desktop. The new otherLauncherFor() scans $XDG_DATA_HOME/applications/*.desktop. It skips GAIA's own file and any entry marked X-GAIA-AppImage=true, and it matches an entry when the Exec= program (quotes, escapes and %% undone) or TryExec= resolves to $APPIMAGE. Symlinks are compared by realpath.
  • On a match it returns kept-existing with the other entry's path. It deletes gaia-desktop.desktop only when that file carries GAIA's marker; one without the marker still returns kept-existing earlier, as before. The icon is left in place.
  • Left out on purpose: an entry pointing at an older versioned AppImage path. Matching it on StartupWMClass or Name would suppress GAIA's launcher in favour of an entry that may no longer launch anything. The tester's ls output would show whether that case happens.
  • Dangling symlinks and non-files in the folder are skipped. Other read errors still surface through the existing "Could not write GAIA's launcher" error.

An AppImage launch now looks for another entry in the user's applications
folder whose Exec= or TryExec= runs this AppImage (directly or through a
symlink), as AppImageLauncher, Gear Lever or a hand-made launcher write.
When one exists GAIA writes no launcher of its own and removes the one it
wrote earlier, so the app grid shows GAIA once. Entries GAIA did not write
are never touched.

Closes #7139
@kovtcharov

Copy link
Copy Markdown
Contributor

Superseded by #7149, which carries this exact change (same patch) together with the Wayland first-launch fix, verified on Fedora 44 with Gear Lever. This one can be closed once #7149 merges.

huong8373tt-beep pushed a commit to huong8373tt-beep/gaia that referenced this pull request Nov 11, 2026
…land (amd#7149)

On Fedora, GAIA showed up twice in the app grid and in Gear Lever, and a
reinstall never fixed it: Gear Lever had already added the AppImage, and
since rc15 GAIA wrote a second launcher next to it on every launch. GAIA
now keeps the manager's entry and removes the duplicate it wrote. The
same Fedora run found a second fault: run as an AppImage on Wayland,
GAIA started with no window at all, and launching it a second time was
the only thing that showed it. The window now opens on the first launch.

Both faults were reproduced and the fix checked on Fedora 44 with GNOME
Shell 50, the real Gear Lever and the rc16 AppImage (Fedora under WSL,
GNOME Shell in its devkit window). Not yet run on a bare-metal Fedora
desktop, so the missing window could be specific to that graphics stack;
the fallback costs nothing where the window already paints.

Closes amd#7139
Refs amd#7138
Supersedes amd#7140 (its commit is included).

## Test plan

- [x] `cd tests/electron && npx jest` on Fedora 44: 62 suites pass
- [x] Fedora 44 + Gear Lever, rc16 AppImage: two launchers
(`gaia.desktop`, `gaia-desktop.desktop`), Gear Lever lists GAIA twice,
no window in GNOME after 90 s
- [x] Same setup, rc16 with this change packed into an AppImage: one
launcher left, Gear Lever lists GAIA once, GNOME ties the window to Gear
Lever's entry, the window opens on first launch (2 of 2 runs; rc16 0 of
5)
- [x] ✕ on GNOME with no tray extension: the window minimizes and GAIA
keeps running
- [ ] Bare-metal Fedora Workstation with Gear Lever: launch the next RC
once; GAIA is listed once and its window opens

<details>
<summary>🔍 Technical details</summary>

- Gear Lever writes `Exec=env DESKTOPINTEGRATION=1 <path> --no-sandbox
%U` with `TryExec=<path>`, so the match comes from `TryExec=`. A test
pins that exact entry.
- Gear Lever lists any entry in `~/.local/share/applications` whose
`TryExec=` is a file in its AppImages folder, which is why GAIA's own
entry appeared there with no version.
- `services/window-reveal.cjs`: `revealWhenReady()` runs on
`ready-to-show`, or one second after `did-finish-load` when that event
hasn't fired. In the failing case `did-finish-load` fires and
`ready-to-show` never does. The same files run unpacked do fire
`ready-to-show`; why the mounted AppImage differs is not pinned down.
- Three of the launcher tests from amd#7140 fail on a Windows host (symlink
rights, backslash paths); they pass on Linux, which is what CI runs.
</details>

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Kalin Ovtcharov <[email protected]>
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #7149, which merged with this commit included and also skips other launchers it can't read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(linux): GAIA shows twice in the Fedora app grid after updating to rc15

2 participants