Fix peristent class on buttons

Fixes: #3009

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
pull/3037/head
Jo De Boeck 2024-03-19 07:40:35 +02:00
parent 2c927de4c6
commit 2ffd9a94a5
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
if (output.asString() == bar_.output->name) { if (output.asString() == bar_.output->name) {
Json::Value v; Json::Value v;
v["name"] = p_w_name; v["name"] = p_w_name;
v["output"] = bar_.output->name; v["target_output"] = bar_.output->name;
v["num"] = convertWorkspaceNameToNum(p_w_name); v["num"] = convertWorkspaceNameToNum(p_w_name);
workspaces_.emplace_back(std::move(v)); workspaces_.emplace_back(std::move(v));
break; break;
@ -166,7 +166,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
// Adding to all outputs // Adding to all outputs
Json::Value v; Json::Value v;
v["name"] = p_w_name; v["name"] = p_w_name;
v["output"] = ""; v["target_output"] = "";
v["num"] = convertWorkspaceNameToNum(p_w_name); v["num"] = convertWorkspaceNameToNum(p_w_name);
workspaces_.emplace_back(std::move(v)); workspaces_.emplace_back(std::move(v));
} }
@ -313,7 +313,7 @@ auto Workspaces::update() -> void {
} else { } else {
button.get_style_context()->remove_class("urgent"); button.get_style_context()->remove_class("urgent");
} }
if (hasFlag((*it), "target_output")) { if ((*it)["target_output"].isString()) {
button.get_style_context()->add_class("persistent"); button.get_style_context()->add_class("persistent");
} else { } else {
button.get_style_context()->remove_class("persistent"); button.get_style_context()->remove_class("persistent");