Skip to content

Commit

Permalink
improve handling of special workspace name
Browse files Browse the repository at this point in the history
  • Loading branch information
jramrath committed Feb 9, 2024
1 parent 692f8f4 commit d4331ce
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ void Workspaces::doUpdate() {
auto sws = monitor["specialWorkspace"];
auto name = sws["name"].asString();
if (sws.isObject() && (sws["name"].isString()) && !name.empty()) {
visibleWorkspaces.push_back(name == "special" ? "special"
: name.substr(8, name.length() - 8));
visibleWorkspaces.push_back(name.starts_with("special:") ? name : name.substr(8));
}
}

Expand Down Expand Up @@ -307,9 +306,7 @@ void Workspaces::onWorkspaceActivated(std::string const &payload) {

void Workspaces::onSpecialWorkspaceActivated(std::string const &payload) {
std::string name(begin(payload), begin(payload) + payload.find_first_of(','));
m_activeSpecialWorkspaceName = (
( name == "special" || name == "" ) ? name : name.substr(8, name.length() - 8)
);
m_activeSpecialWorkspaceName = (!name.starts_with("special:") ? name : name.substr(8));
}

void Workspaces::onWorkspaceDestroyed(std::string const &payload) {
Expand Down

0 comments on commit d4331ce

Please sign in to comment.