privacy: fix visibility when a module is disabled
Only consider a privacy module as visible if it is enabled in the configuration. Otherwise, when screensharing or audio-in or audio-out is in use but the associated module is not enabled, the privacy widget is empty but still considered as visible.
This commit is contained in:
parent
061c68ce92
commit
50a4fe9623
|
@ -121,21 +121,22 @@ void Privacy::onPrivacyNodesChanged() {
|
||||||
|
|
||||||
auto Privacy::update() -> void {
|
auto Privacy::update() -> void {
|
||||||
mutex_.lock();
|
mutex_.lock();
|
||||||
bool screenshare = !nodes_screenshare.empty();
|
bool screenshare, audio_in, audio_out;
|
||||||
bool audio_in = !nodes_audio_in.empty();
|
|
||||||
bool audio_out = !nodes_audio_out.empty();
|
|
||||||
|
|
||||||
for (Gtk::Widget* widget : box_.get_children()) {
|
for (Gtk::Widget* widget : box_.get_children()) {
|
||||||
PrivacyItem* module = dynamic_cast<PrivacyItem*>(widget);
|
PrivacyItem* module = dynamic_cast<PrivacyItem*>(widget);
|
||||||
if (!module) continue;
|
if (!module) continue;
|
||||||
switch (module->privacy_type) {
|
switch (module->privacy_type) {
|
||||||
case util::PipewireBackend::PRIVACY_NODE_TYPE_VIDEO_INPUT:
|
case util::PipewireBackend::PRIVACY_NODE_TYPE_VIDEO_INPUT:
|
||||||
|
screenshare = !nodes_screenshare.empty();
|
||||||
module->set_in_use(screenshare);
|
module->set_in_use(screenshare);
|
||||||
break;
|
break;
|
||||||
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_INPUT:
|
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_INPUT:
|
||||||
|
audio_in = !nodes_audio_in.empty();
|
||||||
module->set_in_use(audio_in);
|
module->set_in_use(audio_in);
|
||||||
break;
|
break;
|
||||||
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_OUTPUT:
|
case util::PipewireBackend::PRIVACY_NODE_TYPE_AUDIO_OUTPUT:
|
||||||
|
audio_out = !nodes_audio_out.empty();
|
||||||
module->set_in_use(audio_out);
|
module->set_in_use(audio_out);
|
||||||
break;
|
break;
|
||||||
case util::PipewireBackend::PRIVACY_NODE_TYPE_NONE:
|
case util::PipewireBackend::PRIVACY_NODE_TYPE_NONE:
|
||||||
|
|
Loading…
Reference in New Issue