pulseaudio: avoid retaining outdated form factor

when the module fails to get the pulseaudio device form factor, the
module persists the existing value, resulting in the incorrect
format-icon being used to format the label on device changes.

reset the form factor value so that the icon lookup properly falls back
to "default" when missing
This commit is contained in:
Bao Trinh 2022-06-14 13:57:03 -05:00
parent 249c0aad73
commit e57899c0c5
No known key found for this signature in database
GPG Key ID: A9B3110B4EA55E36

View File

@ -190,6 +190,8 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_
pa->port_name_ = i->active_port != nullptr ? i->active_port->name : "Unknown";
if (auto ff = pa_proplist_gets(i->proplist, PA_PROP_DEVICE_FORM_FACTOR)) {
pa->form_factor_ = ff;
} else {
pa->form_factor_ = "";
}
pa->dp.emit();
}