-
Notifications
You must be signed in to change notification settings - Fork 9
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
Media Keys stop working after closing window #43
Comments
The only thing I know about electron is from supporting this library, but I'll take a guess. I think there are two threads in an electron app, the UI thread and the background thread. My guess is that when you close the window, the UI thread is suspended and resumed which is a case I haven't tested. If you're running mpris-service on the UI thread, that's probably not going to work. You have to run it on the other thread. See the implementation examples in #30 and see if you're doing anything different. |
I'm running it on the main thread as far as I know. When closing the app with the close button, the process in the terminal (From launching the app from the terminal) also finishes. I've tried getting direct access to the mediaKeys bus in the way GPMDP does here: https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-/blob/master/src/main/features/linux/mediaKeysDBus.js But I'm getting: DBusError: The name is not activatable |
You're probably getting that because you're not running the settings daemon. Or maybe it's broken, I don't know. Note also that player uses this library as well. It sounds to me like the process isn't terminating for some reason. In that case, it will keep the name on the bus. The library is supposed to use another name in that case. There's nothing I can really do in the library in that case. You can see all the names on the bus with this command:
Look for anything with |
I'm going to close this because it sounds more like an electron error than a library error, but if you resolve this or get more info, post here so other people can know how to avoid this issue. |
Hello there!
I'm working on a little desktop Youtube Music App. It uses this library to provide the Metadata and controls on Gnome. When running the app for the first time it works perfectly, but if I close the app window and restart it, the keyboard media keys do not work any more (The notification and the controls there by clicking still work).
By some reason, if I instead close the app by Ctrl+C on the terminal and then open it again, the media keys keep working the next time I open the app.
The only way I found to get the media keys working again once "they are lost" is by closing the session and re-login.
OS: Fedora 30 Workstation
Gnome Version: 3.32.2
Node: 12.9.0
Electron: 6.0.3
The text was updated successfully, but these errors were encountered: