From b35ce3f6b2544da71ab6b9659229ff308929d64a Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Tue, 26 Mar 2024 21:35:02 +0100 Subject: [PATCH] Fix source event handling. A source event has the first bit always set, whereas we only handle events that equal 0x10 (PA_SUBSCRIPTION_EVENT_CHANGE). Now the bitmask is correctly handled. Fixes https://github.com/scorpion-26/gBar/issues/82 --- src/PulseAudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PulseAudio.h b/src/PulseAudio.h index b65aca7..a90c8ed 100644 --- a/src/PulseAudio.h +++ b/src/PulseAudio.h @@ -199,7 +199,7 @@ namespace PulseAudio auto subscribeCallback = [](pa_context*, pa_subscription_event_type_t type, uint32_t, void*) { - if (type == PA_SUBSCRIPTION_EVENT_CHANGE) + if (type & PA_SUBSCRIPTION_EVENT_CHANGE) queueUpdate = true; }; pa_context_set_subscribe_callback(context, +subscribeCallback, nullptr);