NXM link handler opens a new window every time instead of reusing the running instance
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
Direzione di ricerca
Examine Program.cs for the single-instance detection logic using Process.GetProcessesByName. Understand the Flatpak PID namespace limitation. Look at Pathing.GetLinksCachePath() and the _nxmSentinelTimer_Tick method that polls Links.json. The fix involves modifying instance detection to work across Flatpak invocations, possibly using a lock file in the shared config directory or implementing D-Bus service activation. Test by setting up the .desktop handler and clicking multiple nxm:// links.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When Stardrop is set up as the nxm:// protocol handler (via a .desktop file with MimeType=x-scheme-handler/nxm calling flatpak run ... --command=Stardrop io.github.Adda0.Stardrop --nxm %u), clicking a second "Mod Manager Download" link on Nexus Mods while Stardrop is already open opens a new, full Stardrop window instead of handing the link to the already-running instance.
Root cause:
Stardrop's single-instance detection in Program.cs works by counting OS processes with its own name:
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName)
.Count() > 1 && RuntimeInformation.IsOSPlatform(OSPlatform.OSX) is false)
If more than one process is found, the newly-launched instance treats itself as "secondary": it writes the link to Links.json (via Pathing.GetLinksCachePath()) and exits, letting the primary instance's _nxmSentinelTimer_Tick (which polls that file every second) pick it up.
This breaks under Flatpak: every flatpak run invocation gets its own PID namespace, so the sandboxed process can only ever see itself when it calls Process.GetProcessesByName. The count is always 1, so it never detects the already-running instance, never writes to Links.json, and always proceeds as a fresh primary instance — opening a full new window every time.
Repro steps:
- Set up nxm:// handling for the Flatpak build (.desktop file with --nxm %u).
- Launch Stardrop by clicking a Nexus "Mod Manager Download" link.
- With Stardrop still open, click a second download link.
- Expected: the link is handed to the already-open window (as happens on non-Flatpak installs). Actual: a second full Stardrop window opens.
Suggested fix directions:
- Have the Flatpak build grant --talk-name=org.freedesktop.DBus/session-bus access and switch instance detection to D-Bus service activation (the standard, sandbox-safe approach), or
- Have Process.GetProcessesByName's check fall back to (or be replaced by) checking for a lock/PID file that's meaningful across separate flatpak run invocations — e.g. a lock file under the app's data dir (~/.var/app/io.github.Adda0.Stardrop/config/Stardrop/Data/) that's already shared across launches via the filesystems=home permission.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flathub/io.github.Adda0.Stardrop
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
flathub/io.github.Adda0.Stardrop#5 · 1 commento ·
Tutte le issue di flathub/io.github.Adda0.Stardrop
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anomalyco/opencode#60174 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fullsend-ai/agents#1833 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
github/copilot-cli#5287 ·