Fixed cases where the module would be hidden when it should be visible
This commit is contained in:
parent
f7224d8459
commit
e73ea8d608
|
@ -30,6 +30,7 @@ class Privacy : public AModule {
|
|||
PrivacyItem privacy_item_audio_input;
|
||||
PrivacyItem privacy_item_audio_output;
|
||||
|
||||
std::mutex mutex_;
|
||||
sigc::connection visibility_conn;
|
||||
|
||||
// Config
|
||||
|
|
|
@ -67,6 +67,7 @@ Privacy::Privacy(const std::string& id, const Json::Value& config, const std::st
|
|||
}
|
||||
|
||||
void Privacy::onPrivacyNodesChanged() {
|
||||
mutex_.lock();
|
||||
nodes_audio_out.clear();
|
||||
nodes_audio_in.clear();
|
||||
nodes_screenshare.clear();
|
||||
|
@ -100,6 +101,7 @@ void Privacy::onPrivacyNodesChanged() {
|
|||
}
|
||||
}
|
||||
|
||||
mutex_.unlock();
|
||||
dp.emit();
|
||||
}
|
||||
|
||||
|
@ -121,9 +123,13 @@ auto Privacy::update() -> void {
|
|||
if (is_visible) {
|
||||
event_box_.set_visible(true);
|
||||
} else {
|
||||
visibility_conn = Glib::signal_timeout().connect(sigc::track_obj(
|
||||
visibility_conn = Glib::signal_timeout().connect(
|
||||
sigc::track_obj(
|
||||
[this] {
|
||||
event_box_.set_visible(false);
|
||||
bool screenshare = !nodes_screenshare.empty();
|
||||
bool audio_in = !nodes_audio_in.empty();
|
||||
bool audio_out = !nodes_audio_out.empty();
|
||||
event_box_.set_visible(screenshare || audio_in || audio_out);
|
||||
return false;
|
||||
},
|
||||
*this),
|
||||
|
|
Loading…
Reference in New Issue