Current Glade versions want object IDs to be unique, but currently
pavucontrol.glade shares some IDs between the top-level windows. I guess
this used to be OK in the past, and the "interface-naming-policy
toplevel-contextual" comment in the beginning of the .glade file
probably has something to do with this. I want to update the .glade file
to be easy to work with current Glade versions, so I will remove the
duplicated object IDs.
The first IDs to change are the "channelsVBox", "nameLabel",
"boldNameLabel" and "iconImage" IDs. These were used by
MinimalStreamWidget to create widgets for both devices and streams, but
now that the IDs are different for devices and streams, the widgets have
to be created by the subclasses.
MinimalStreamWidget doesn't need the Gtk::Builder in its constructor any
more, so remove that parameter to avoid warnings about an unused
variable.
It seems that without explicit initialization of the members they remain
uninitialized. The lack of initialization caused crashing, because
PavuApplication::on_activate() creates the MainWindow only if mainWindow
is NULL, and if it's some random value instead, on_activate() calls
selectTab() on a non-existent window.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/49
This introduces a new file for clarity. Options
handling changes so that --tab changes the tab
if the window is already opened. Other options
are only used at start time.
Also remove the minimum supported PulseAudio version. The current
minimum libpulse version is 5.0, but if it's written on the page, the
information will inevitably get out of date sooner or later.
The previous translation may sound like "Lock up the channels", better
to add the "together" (insieme) in there like in the English version
which gives more the idea of aggregation.
Some fixes for strings which show up on the GUI.
In particular "Blocca entrambi i canali" (which translates back to
"Block both channels") sounded weird with devices with more than
2 channels.
Some lynx versions produce links of the form file:///..., others produce
file://localhost/..., so catch both forms.
Reported-by: Peter Mattern <matternp@arcor.de>
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Fixes for out-of-tree build, as well as making --disable-lynx work
correctly. Note that make dist will fail if lynx support is disabled (as
it should, since README will then not be available to put in the
tarball).
Due to another bug the MIME type guessing of PNG files was broken on my
Ubuntu system. This made pavucontrol crash on startup (while loading the
necessary icons) without a helpful error message (requiring a lot of
debugging effort). Although this is not originally pavucontrol's fault,
I think that pavucontrol could be more robust about such a problem,
especially because:
A) In a complex database like the one to guess MIME types (that is populated
from hundres of different packages) this can happen from time to time and
B) pavucontrol already has some fallback options in place - they are just not
active in this specific case.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88813
pa_stream_peek can return NULL if either the buffer is empty or if it
has a hole. In either case we need to avoid derefencing the data
pointer. Additionally, if there is a hole, we need to call pa_stream_drop,
if the buffer is empty we should not call it.
BugLink: https://bugs.debian.org/735898
RoleWidget::create contains:
x->get_widget_derived("streamWidget", w);
But streamWidget is defined as following in the glade file:
<object class="GtkEventBox" id="streamWidget">
Where as RoleWidget is derived from [Minimal]StreamWidget, which is derived
from Gtk::VBox, so this is clearly wrong.
Adding:
printf("rolewidget type: %s\n", g_type_name(G_TYPE_FROM_INSTANCE(w->gobj())));
for debugging shows that this really leads to RoleWidget being instantiated
as an EventBox (yet things still work due to sheer luck).
This commit fixes this, by putting the streamWidget id at the right level of
the hierarchy in the glade file (and likewise for cardWidget and deviceWidget).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Widgets (unlike Windows and Dialogs) returned by Gtk::Builder::get_widget*
start owned by the GtkBuilder object, the idea being that they will get
added to a container before the scope of the GtkBuilder object ends, and it
thus automatically gets destroyed.
But in the various ::create methods in pavucontrol, a pointer to the widget
gets returned, so that it can be added to a cointainer by the caller.
However as soon as the ::create method exits the GtkBuilder object owning
the widget, and thus also the widget gets destroyed, and we end up returning
free-ed memory.
This commit fixes this by making all ::create methods take a reference on
the widget before returning it, and having all the callers unreference the
widget after adding it to a container.
https://bugs.freedesktop.org/show_bug.cgi?id=83144https://bugzilla.redhat.com/show_bug.cgi?id=1133339
Signed-off-by: Hans de Goede <hdegoede@redhat.com>