From f573fcc5311e887280bfb77c7128de2bc863e5c5 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 1 Jun 2016 07:49:14 +0200 Subject: [PATCH] fix(bspwm): Do not output empty click handlers --- src/modules/bspwm.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/bspwm.cpp b/src/modules/bspwm.cpp index 949fa5d4..7a76a94e 100644 --- a/src/modules/bspwm.cpp +++ b/src/modules/bspwm.cpp @@ -198,15 +198,18 @@ bool BspwmModule::build(Builder *builder, const std::string& tag) int workspace_n = 0; for (auto &&ws : this->workspaces) { - builder->cmd(Cmd::LEFT_CLICK, std::string(EVENT_CLICK) + std::to_string(++workspace_n)); - builder->node(ws.get()->label); + if (!ws.get()->label->text.empty()) + builder->cmd(Cmd::LEFT_CLICK, std::string(EVENT_CLICK) + std::to_string(++workspace_n)); - if (ws->flag == WORKSPACE_ACTIVE && this->formatter->has(TAG_LABEL_MODE)) { - for (auto &&mode : this->modes) - builder->node(mode->get()); - } + builder->node(ws.get()->label); - builder->cmd_close(true); + if (ws->flag == WORKSPACE_ACTIVE && this->formatter->has(TAG_LABEL_MODE)) { + for (auto &&mode : this->modes) + builder->node(mode->get()); + } + + if (!ws.get()->label->text.empty()) + builder->cmd_close(true); } return true;