pavuapplication: allow one window per server
It was reported[1] that some users want to use multipe pavucontrol instances simultaneously to control multiple remote servers. Since pavucontrol 4.0 we have allowed only one window at a time, however. This patch relaxes the one window rule so that there can be one window per server (or per PULSE_SERVER value, to be precise).
This is implemented by appending the PULSE_SERVER value to the application ID if PULSE_SERVER is set (otherwise the normal ID is used). This works, because Gtk::Application uses the application ID to detect already running application instances. It's pretty ugly to mangle the application ID, because there's supposed to be only one ID per application, but I'm not aware of anything that would break or misbehave because of this.
[1] https://lists.freedesktop.org/archives/pulseaudio-discuss/2019-March/030929.html
Merge request reports
Activity
It's pretty ugly to mangle the application ID
I suppose the proper way of doing this would be to handle
Application
'scommand-line
signal to either present an existing window or open a new one, depending on the environment provided.This would mean having all windows in a single process, with a different pulse client for each window.
Edited by Jan Alexander Steffens
I'm not using
-
as the separator, I'm using_
. Does that change things? Also,_
is used also for replacing characters that aren't allowed in application IDs, and using.
for that has the problem that application IDs must not have two consecutive periods in them, and they must not end with a period.I doubt this has any effect on flatpak packaging, because the mangled application ID doesn't show up in any files, it's only used in the D-Bus name (and only when
PULSE_SERVER
is set). Does flatpak care about the application's D-Bus name?