diff --git a/src/idle.cpp b/src/idle.cpp index 8fd6b03..e535b0a 100644 --- a/src/idle.cpp +++ b/src/idle.cpp @@ -55,14 +55,14 @@ void Idle::update(bool isRunning) { if (idle == NULL) { idle = zwp_idle_inhibit_manager_v1_create_inhibitor( wl_idle_inhibit_manager, surface); - wl_display_sync(display); + wl_display_roundtrip(display); } cout << "IDLE INHIBITED" << endl; } else { if (idle != NULL) { zwp_idle_inhibitor_v1_destroy(idle); idle = NULL; - wl_display_sync(display); + wl_display_roundtrip(display); } cout << "NOT IDLE INHIBITED" << endl; } diff --git a/src/pulse.cpp b/src/pulse.cpp index abe58ec..ddc98a6 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -29,7 +29,7 @@ int Pulse::init(SubscriptionType subscriptionType, void Pulse::sink_input_info_callback(pa_context *, const pa_sink_input_info *i, int, void *userdata) { Data *data = (Data *)userdata; - if (i && !i->corked) data->activeSink = true; + if (i && !i->corked && i->client != PA_INVALID_INDEX) data->activeSink = true; pa_threaded_mainloop_signal(data->mainloop, 0); } @@ -37,7 +37,7 @@ void Pulse::source_output_info_callback(pa_context *, const pa_source_output_info *i, int, void *userdata) { Data *data = (Data *)userdata; - if (i && !i->corked) data->activeSource = true; + if (i && !i->corked && i->client != PA_INVALID_INDEX) data->activeSource = true; pa_threaded_mainloop_signal(data->mainloop, 0); }