From 0b01b35c768d293caa90e942f2a8107bb1694403 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 31 May 2019 16:21:01 +0200 Subject: [PATCH] refactor(pulseaudio): only watch changes --- src/modules/pulseaudio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index b656d154..4ed0d625 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -128,6 +128,10 @@ void waybar::modules::Pulseaudio::subscribeCb(pa_context * conte pa_subscription_event_type_t type, uint32_t idx, void *data) { unsigned facility = type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK; + unsigned operation = type & PA_SUBSCRIPTION_EVENT_TYPE_MASK; + if (operation != PA_SUBSCRIPTION_EVENT_CHANGE) { + return; + } if (facility == PA_SUBSCRIPTION_EVENT_SINK) { pa_context_get_sink_info_by_index(context, idx, sinkInfoCb, data); } else if (facility == PA_SUBSCRIPTION_EVENT_SOURCE) {