privacy: default to ignoring all stream.monitor pw nodes
This commit is contained in:
@ -32,6 +32,7 @@ class Privacy : public AModule {
|
||||
uint iconSize = 20;
|
||||
uint transition_duration = 250;
|
||||
std::set<std::pair<PrivacyNodeType, std::string>> ignore;
|
||||
bool ignore_monitor = true;
|
||||
|
||||
std::shared_ptr<util::PipewireBackend::PipewireBackend> backend = nullptr;
|
||||
};
|
||||
|
@ -25,6 +25,7 @@ class PrivacyNodeInfo {
|
||||
std::string media_name;
|
||||
std::string node_name;
|
||||
std::string application_name;
|
||||
bool is_monitor = false;
|
||||
|
||||
std::string pipewire_access_portal_app_id;
|
||||
std::string application_icon_name;
|
||||
|
@ -86,6 +86,10 @@ Privacy::Privacy(const std::string& id, const Json::Value& config, Gtk::Orientat
|
||||
}
|
||||
}
|
||||
|
||||
if (config_["ignore-monitor"].isBool()) {
|
||||
ignore_monitor = config_["ignore-monitor"].asBool();
|
||||
}
|
||||
|
||||
backend = util::PipewireBackend::PipewireBackend::getInstance();
|
||||
backend->privacy_nodes_changed_signal_event.connect(
|
||||
sigc::mem_fun(*this, &Privacy::onPrivacyNodesChanged));
|
||||
@ -100,6 +104,9 @@ void Privacy::onPrivacyNodesChanged() {
|
||||
nodes_screenshare.clear();
|
||||
|
||||
for (auto& node : backend->privacy_nodes) {
|
||||
if (ignore_monitor && node.second->is_monitor)
|
||||
continue;
|
||||
|
||||
auto iter = ignore.find(std::pair(node.second->type, node.second->node_name));
|
||||
if (iter != ignore.end())
|
||||
continue;
|
||||
|
@ -49,6 +49,8 @@ void PrivacyNodeInfo::handleNodeEventInfo(const struct pw_node_info *info) {
|
||||
pipewire_access_portal_app_id = item->value;
|
||||
} else if (strcmp(item->key, PW_KEY_APP_ICON_NAME) == 0) {
|
||||
application_icon_name = item->value;
|
||||
} else if (strcmp(item->key, "stream.monitor") == 0) {
|
||||
is_monitor = strcmp(item->value, "true") == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user