From 7f7ebb5367751c9c6eb82226c9168cf6e809d16c Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 19 Oct 2019 16:19:35 +0100 Subject: [PATCH] fix(workspaces): add int comparison --- src/modules/sway/workspaces.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 23cf0ce..b65e47d 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -88,6 +88,9 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) { std::sort(workspaces_.begin(), workspaces_.end(), [](const Json::Value &lhs, const Json::Value &rhs) { + if (lhs["name"].isInt() && rhs["name"].isInt()) { + return lhs["name"].asInt() < rhs["name"].asInt(); + } return lhs["name"].asString() < rhs["name"].asString(); }); }