feat(workspace): only show workspaces which are on same output as bar

This commit is contained in:
Alexis
2018-08-11 00:32:59 +02:00
parent 2512d51564
commit 424ebb3c9b
7 changed files with 62 additions and 58 deletions

View File

@ -22,6 +22,7 @@ waybar::modules::Workspaces::Workspaces(Bar &bar)
auto waybar::modules::Workspaces::update() -> void
{
if (_bar.outputName.empty()) return;
Json::Value workspaces = _getWorkspaces();
bool needReorder = false;
for (auto it = _buttons.begin(); it != _buttons.end(); ++it) {
@ -34,7 +35,7 @@ auto waybar::modules::Workspaces::update() -> void
}
for (auto node : workspaces) {
auto it = _buttons.find(node["num"].asInt());
if (it == _buttons.end()) {
if (it == _buttons.end() && _bar.outputName == node["output"].asString()) {
_addWorkspace(node);
needReorder = true;
} else {