Skip to content

Commit

Permalink
fix(tray): fix visibility of Passive items
Browse files Browse the repository at this point in the history
Passive items could still be displayed if `show_all()` is invoked from
`tray.cpp` after the individual icon visibility is set.
  • Loading branch information
alebastr committed Sep 20, 2021
1 parent 8534175 commit dc67bcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/modules/sni/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Item::Item(const std::string& bn, const std::string& op, const Json::Value& conf
event_box.signal_button_press_event().connect(sigc::mem_fun(*this, &Item::handleClick));
event_box.signal_scroll_event().connect(sigc::mem_fun(*this, &Item::handleScroll));
// initial visibility
event_box.show_all();
event_box.set_visible(show_passive_);

cancellable_ = Gio::Cancellable::create();
Expand Down
6 changes: 1 addition & 5 deletions src/modules/sni/tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ void Tray::onRemove(std::unique_ptr<Item>& item) {
}

auto Tray::update() -> void {
if (box_.get_children().empty()) {
box_.hide();
} else {
box_.show_all();
}
box_.set_visible(!box_.get_children().empty());
// Call parent update
AModule::update();
}
Expand Down

0 comments on commit dc67bcc

Please sign in to comment.