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
This commit is contained in:
scorpion-26 2024-03-26 21:35:02 +01:00
parent 535d02c63c
commit b35ce3f6b2

View file

@ -199,7 +199,7 @@ namespace PulseAudio
auto subscribeCallback = [](pa_context*, pa_subscription_event_type_t type, uint32_t, void*) 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; queueUpdate = true;
}; };
pa_context_set_subscribe_callback(context, +subscribeCallback, nullptr); pa_context_set_subscribe_callback(context, +subscribeCallback, nullptr);