sway/mode: enable pango markup on supported modes

IPC reports {"mode": "mode_string", "pango_markup": bool}.
Use this to conditionally enable pango markup.
This commit is contained in:
xPMo 2019-08-28 19:48:33 -05:00
parent 9d0842db48
commit e38df047fd
No known key found for this signature in database
GPG Key ID: 729F51A37C722F72
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ void Mode::onEvent(const struct Ipc::ipc_response& res) {
std::lock_guard<std::mutex> lock(mutex_);
auto payload = parser_.parse(res.payload);
if (payload["change"] != "default") {
mode_ = Glib::Markup::escape_text(payload["change"].asString());
if (payload["pango_markup"].asBool()) {
mode_ = payload["change"].asString();
} else {
mode_ = Glib::Markup::escape_text(payload["change"].asString());
}
} else {
mode_.clear();
}