Skip to content

Commit f2edc8f

Browse files
committed
feat(Watcher): define watcher_id
1 parent 7b11283 commit f2edc8f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

include/modules/sni/watcher.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace waybar::modules::SNI {
88

99
class Watcher {
1010
public:
11-
Watcher();
11+
Watcher(std::size_t id);
1212
~Watcher();
1313

1414
private:

src/modules/sni/tray.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace waybar::modules::SNI {
66
Tray::Tray(const std::string& id, const Bar& bar, const Json::Value& config)
77
: config_(config),
88
box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0),
9+
watcher_(nb_hosts_),
910
host_(nb_hosts_, config, std::bind(&Tray::onAdd, this, std::placeholders::_1),
1011
std::bind(&Tray::onRemove, this, std::placeholders::_1)) {
1112
box_.set_name("tray");

src/modules/sni/watcher.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
using namespace waybar::modules::SNI;
66

7-
Watcher::Watcher()
7+
Watcher::Watcher(std::size_t id)
88
: bus_name_id_(Gio::DBus::own_name(Gio::DBus::BusType::BUS_TYPE_SESSION,
99
"org.kde.StatusNotifierWatcher",
1010
sigc::mem_fun(*this, &Watcher::busAcquired),
1111
Gio::DBus::SlotNameAcquired(), Gio::DBus::SlotNameLost(),
1212
Gio::DBus::BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
1313
Gio::DBus::BUS_NAME_OWNER_FLAGS_REPLACE)),
14+
watcher_id_(id),
1415
watcher_(sn_watcher_skeleton_new()) {}
1516

1617
Watcher::~Watcher() {

0 commit comments

Comments
 (0)