[Flatpak] Can open multiple instances
ATM when e.g. opening a MuseScore file from a file manager, it opens a new instance that thinks the previous crashed, even though it’s still running.
I’m the maintainer of the Flatpak package; I’d like to get this fixed, but I’m not sure where to look. How does MuseScore check for already running instances?
Thanks.
Comments
It probably check for the session file?
In reply to It probably check for the… by Jojo-Schmitz
Where is that file located?
In reply to Where is that file located? by jurf
Next to where the shortcuts.xml, plugins.xml and autosave files are stored, so for Linux in ~/.local/share/data/MuseScore/MuseScore2/
In reply to Next to where the shortcuts… by Jojo-Schmitz
That’s weird, it gets created properly, but it’s as if it’s not read on launch. I wonder if it’s because XDG_DATA_HOME is overriden. Maybe it’s hardcoded when read.
In reply to Next to where the shortcuts… by Jojo-Schmitz
Scratch that, it must read it, because it detects a ‘previous’ instance has ‘crashed’ and can ‘recover’ the session from it.
Isn’t there another check in place?
In reply to Scratch that, it must read… by jurf
I had the same issue long time ago.
See https://musescore.org/en/node/9036, there is a file in temp.
In reply to I had the same issue long… by Bart.S
There are files created (and deleted) in %TEMP% (Windows) or $TEMP (Mac/Linux), while MuseScore is running but they look like random names, nothing a 2nd instance could be looking for?
In reply to There are files in %TEMP% … by Jojo-Schmitz
The code responsible of single instance checking is in https://github.com/musescore/MuseScore/tree/2.2.1/thirdparty/singleapp
In reply to The code responsible of… by [DELETED] 5
Found it, a simple pointing the TMPDIR to XDG_CACHE_HOME fixed issue. Thanks for the help!
https://github.com/flathub/org.musescore.MuseScore/commit/c41669a865099…