Skip to content

Commit

Permalink
Merge pull request #2686 from aruhier/pr_privacy_visibility
Browse files Browse the repository at this point in the history
privacy: fix visibility when a module is disabled
  • Loading branch information
Alexays authored Nov 23, 2023
2 parents 061c68c + 50a4fe9 commit 1fe4a4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/privacy/privacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,22 @@ void Privacy::onPrivacyNodesChanged() {

auto Privacy::update() -> void {
mutex_.lock();
bool screenshare = !nodes_screenshare.empty();
bool audio_in = !nodes_audio_in.empty();
bool audio_out = !nodes_audio_out.empty();
bool screenshare, audio_in, audio_out;

for (Gtk::Widget* widget : box_.get_children()) {
PrivacyItem* module = dynamic_cast<PrivacyItem*>(widget);
if (!module) continue;
switch (module->privacy_type) {
case util::PipewireBackend::PRIVACY_NODE_TYPE_VIDEO_INPUT:
screenshare = !nodes_screenshare.empty();
module->set_in_use(screenshare);
break;
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_INPUT:
audio_in = !nodes_audio_in.empty();
module->set_in_use(audio_in);
break;
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_OUTPUT:
audio_out = !nodes_audio_out.empty();
module->set_in_use(audio_out);
break;
case util::PipewireBackend::PRIVACY_NODE_TYPE_NONE:
Expand Down

0 comments on commit 1fe4a4e

Please sign in to comment.