Skip to content

Single instance application: how to open existing window? #17854

Answered by maxkatz6
wl2776 asked this question in Q&A
Discussion options

You must be logged in to vote

Windows: named mutex or file lock
Linux: file lock only
macOS: neither of above work, but packaged macOS are guaranteed to be single instance

And universal option is to get running processes by name, and check if it's the first instance. But that approach is cursed, as requires more access to the user system than it should.

NamedPipes is more or less stable approach to send messages between instances on Windows/Linux/macOS. Lightweight http/tcp server might be better though.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@StefanKoell
Comment options

Answer selected by wl2776
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants