qpwgraph can be used only by one user at same time
mazes-80 opened this issue · comments
When compiling with system tray qpwgraph create a socket in /tmp/ which ends up unique for the whole system.
src/qpwgraph.cpp L136-138
m_unique = QCoreApplication::applicationName();
m_unique += '@';
m_unique += QHostInfo::localHostName();
all user will end up sharing the same socket name, but only one will own this file.
changing those lines to:
m_unique = QCoreApplication::applicationName();
m_unique += '-';
m_unique += qgetenv("UID");;
m_unique += '@';
m_unique += QHostInfo::localHostName();
Would solve the issue when using system tray.
I discovered this issue using qjackctl at same time for 2 users, it should be fixed there too.
The simple fix I propose works only when using system tray, some extra lines may be required when compiled without trayicon support.
how come you're having two (different) users? what's the use case?
I have a session were I use sound, and my son too. I sometimes need to use some routing on sound and he does too.
So qpwgraph and/or qjackctl need to be open at the same time
my son needs it for obs-studio, me for other purpose.
I can also use patchage (which works for my use case), but I really prefer having a tray icon as it is faster to view/hide.
I had no success using qgetenv("UID")
but qgetenv("USER") works as a charm.
With this simple tweak in the name I can start and use qpwgraph on both sessions.
That's the way other softwares also does (like qasmixer).
I also test compiling without trayicon, no problem happens using for multiple users
implemented in 7c1e8ee
ps. next time please use official issue tracker in https://gitlab.freedesktop.org/rncbc/qpwgraph/-/issues