rncbc / qpwgraph

qpwgraph - A PipeWire Graph Qt GUI Interface
https://gitlab.freedesktop.org/rncbc/qpwgraph
GNU General Public License v2.0
246 stars 15 forks source link

Trying to open qpwgraph via the icon always creates a new instance #40

Open zastrixarundell opened 5 months ago

zastrixarundell commented 5 months ago

Hey!

Love this software, but I have one specific irk with it (just a QoL feature). Namely, when I close qpwgraph it works in the background which is perfect. But when I want to open it I have to do it from the notification menu, otherwise another instance of qpwgraph would open so I have to close it, close the 2nd one from the notification menu and then open the first one from the notification.

Keep in mind that I am using flatpak, I'm not sure if it's present on the standard version, I use an immutable OS.

rncbc commented 5 months ago

the standard version has this means (shared memory) to detect whether another instance is already up and running and if it is relinquish control to it and bail out.

upstream (me) knows nothing or very little about flatpak, maybe it just doesn't work if at all under a sandboxed environment; please file an issue to the proper tracker: https://github.com/flathub/org.rncbc.qpwgraph.

there might be an option or special configuration, re. shmem access, when dealing with the flatpak version; otherwise it's all considered normal behavior. thanks

zastrixarundell commented 5 months ago

Hm, this is mot likely something which should be fixed upstream (I'll see to look into it) or potentially patch downstream on flathub (but a better idea would be to just fix it upstream).

I know that it does work on other flatpaks as Vesktop, Spotify, Heroic and Steam, so it's not a general issue with flatpaks.

I did check for example spotify and there's no custom permission which qpwgraph doesn't have.

zastrixarundell commented 5 months ago

if it's not a problem for you, could just just send a permalink for the area of the checks whether a new instance should open? I'm still unfamiliar with this code and it'd be a massive help!

rncbc commented 5 months ago

https://github.com/rncbc/qpwgraph/blob/0a56c93651a250ae162b1d32a73d8b7022702a00/src/qpwgraph.cpp#L147-L270