-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent MPRIS D-Bus duplicate name #1295
Conversation
Append `instance<pid>` to the MPRIS bus name to prevent two instances from fighting over the same bus name.
I noticed that when an ncspot process is running and you open another one, it can't attach itself to the D-Bus bus as each process used the same name. In practice this would mean that when opening a second instance of ncspot when one is already running, my GNOME shell wouldn't display playback controls for the second instance. This could be confusing when the user opens a second instance before they close the first one, in which case the shell won't display any playback controls. The MPRIS specification solves this by appending a unique identifier to each instances' bus name to prevent duplicate names. |
Thanks for the PR. Yeah I think I thought about this back then and was worrying this would break user scripts, because they directly refer to the name |
Firefox uses the PID of the tab that contains the player and appends it like this PR does. Other players might force there to be only one instance per session (like Amberol for example). When you try to start a second Amberol instance, it just brings the original one to the foreground. Technically I think in general, it might start to make sense to release version I don't know whether |
Sounds reasonable, let's get it in then! :) |
Also regarding a 1.0 release: I thought about this recently and I guess ncspot - while it has some bugs regarding session refreshment - is mature enough to deserve a major release. |
Even though it has bugs, you can still release version |
Append
instance<pid>
to the MPRIS bus name to prevent two instances from fighting over the same bus name.