Skip to content

Commit

Permalink
add/remove 'active' on 'focusedmon' IPC event
Browse files Browse the repository at this point in the history
  • Loading branch information
jramrath committed Feb 7, 2024
1 parent 61be226 commit 692f8f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ void Workspaces::onWorkspaceRenamed(std::string const &payload) {

void Workspaces::onMonitorFocused(std::string const &payload) {
m_activeWorkspaceName = payload.substr(payload.find(',') + 1);

for (Json::Value &monitor : gIPC->getSocket1JsonReply("monitors")) {
if (monitor["name"].asString() == payload.substr(0, payload.find(','))) {
auto name = monitor["specialWorkspace"]["name"].asString();
m_activeSpecialWorkspaceName = !name.starts_with("special:") ? name : name.substr(8);
}
}
}

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

0 comments on commit 692f8f4

Please sign in to comment.