Hi, I'm an avid Spotify user and glad it exists, but there is a seemingly easy to fix problem that is a major issue that affects all distributions. Spotify for Linux does not listen to SIGQUIT, which causes the notification icon's "Exit" menu to not work, as well as Spotify preventing logouts. I have to wait at least a minute before Spotify is force closed because it does not listen to SIGQUIT when logging out, which is a bit of a waste of time.
For those of you who do not know what this means, POSIX systems (Linux, UNIX, etc.) use signals for basic inter-app communication. For example, when you log out, your computer tells your apps open "SIGQUIT", or to nicely quit when possible to prevent data loss before logging out. Because there is a chance an app is frozen and isn't listening, most desktops have a timer built in when an app doesn't respond to SIGQUIT within a minute or so, so the desktop will then send SIGINT, which basically tells it to quit immediately, not saving any data. This is why Spotify prevents logout for around a minute, because the desktop is waiting for Spotify to cleanly exit without being forcibly killed.
Steps to reproduce for testing:
1: Open Spotify in a terminal
2: Press CTRL + \ to send SIGQUIT
3: Notice how nothing happens
4: Press CTRL + C to send SIGABRT
5: Notice how that worked.
Considering SIGQUIT tells it to cleanly exit, Spotify should catch SIGQUIT and terminate whenever it's safe. Additionally, catching SIGQUIT will prevent any potential database corruption caused by an unclean exit.
This does not affect the OS X version of Spotify, it registers CTRL + \ as SIGQUIT and exits. Perhaps the code that catches SIGQUIT can be borrowed from the OS X version of Spotify? To test this, you can run /Applications/Spotify.app/Contents/MacOS/Spotify in a terminal and send SIGQUIT with CTRL + \ , and it will quit after a second or so (OS X incorrectly reports this as a crash, since it was not closed through the GUI.)
A fix would be greatly appreciated 🙂