add/remove 'active' on 'focusedmon' IPC event

This commit is contained in:
Jannik 2024-02-07 22:42:05 +01:00
parent 61be2267ab
commit 692f8f4ea4
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -365,6 +365,13 @@ void Workspaces::onWorkspaceRenamed(std::string const &payload) {
void Workspaces::onMonitorFocused(std::string const &payload) { void Workspaces::onMonitorFocused(std::string const &payload) {
m_activeWorkspaceName = payload.substr(payload.find(',') + 1); 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) { void Workspaces::onWindowOpened(std::string const &payload) {