mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
Add the PrivacyNodeInfo object as pw_proxy data
This commit is contained in:
@ -30,7 +30,7 @@ class PipewireBackend {
|
||||
|
||||
sigc::signal<void> privacy_nodes_changed_signal_event;
|
||||
|
||||
std::unordered_map<uint32_t, PrivacyNodeInfo> privacy_nodes;
|
||||
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
|
||||
|
||||
static std::shared_ptr<PipewireBackend> getInstance();
|
||||
|
||||
|
@ -32,17 +32,8 @@ class PrivacyNodeInfo {
|
||||
struct spa_hook object_listener;
|
||||
struct spa_hook proxy_listener;
|
||||
|
||||
bool changed = false;
|
||||
|
||||
void *data;
|
||||
|
||||
PrivacyNodeInfo(uint32_t id_, void *data_) : id(id_), data(data_) {}
|
||||
|
||||
~PrivacyNodeInfo() {
|
||||
spa_hook_remove(&object_listener);
|
||||
spa_hook_remove(&proxy_listener);
|
||||
}
|
||||
|
||||
std::string get_name() {
|
||||
const std::vector<std::string *> names{&application_name, &node_name};
|
||||
std::string name = "Unknown Application";
|
||||
@ -59,7 +50,7 @@ class PrivacyNodeInfo {
|
||||
std::string get_icon_name() {
|
||||
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
|
||||
&application_name, &node_name};
|
||||
std::string name = "application-x-executable-symbolic";
|
||||
const std::string name = "application-x-executable-symbolic";
|
||||
for (auto &name_ : names) {
|
||||
if (name_ != nullptr && name_->length() > 0 && DefaultGtkIconThemeWrapper::has_icon(*name_)) {
|
||||
return *name_;
|
||||
|
Reference in New Issue
Block a user