refactor(tray): infer changed properties from signal name

Comparing two GVariants is too expensive; let's collect the set of
properties updated by each signal and apply them unconditionally.
This commit is contained in:
Aleksei Bavshin
2021-06-23 00:27:42 -07:00
parent 929fc16994
commit 4b6253e810
2 changed files with 35 additions and 16 deletions

View File

@ -11,6 +11,9 @@
#include <libdbusmenu-gtk/dbusmenu-gtk.h>
#include <sigc++/trackable.h>
#include <set>
#include <string_view>
namespace waybar::modules::SNI {
class Item : public sigc::trackable {
@ -64,7 +67,7 @@ class Item : public sigc::trackable {
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
Glib::RefPtr<Gio::Cancellable> cancellable_;
bool update_pending_;
std::set<std::string_view> update_pending_;
};
} // namespace waybar::modules::SNI