[hyprland/workspaces] Fix active workspace not getting updated on multi monitor setups

This commit is contained in:
Tom Benham 2024-04-12 11:33:29 +02:00
parent e8038ef9f3
commit cd3d588abd
1 changed files with 8 additions and 1 deletions

View File

@ -318,7 +318,7 @@ void Workspaces::onEvent(const std::string &ev) {
onWorkspaceCreated(payload); onWorkspaceCreated(payload);
} else if (eventName == "focusedmon") { } else if (eventName == "focusedmon") {
onMonitorFocused(payload); onMonitorFocused(payload);
} else if (eventName == "moveworkspace" && !allOutputs()) { } else if (eventName == "moveworkspace") {
onWorkspaceMoved(payload); onWorkspaceMoved(payload);
} else if (eventName == "openwindow") { } else if (eventName == "openwindow") {
onWindowOpened(payload); onWindowOpened(payload);
@ -387,6 +387,13 @@ void Workspaces::onWorkspaceCreated(std::string const &workspaceName,
void Workspaces::onWorkspaceMoved(std::string const &payload) { void Workspaces::onWorkspaceMoved(std::string const &payload) {
spdlog::debug("Workspace moved: {}", payload); spdlog::debug("Workspace moved: {}", payload);
// Update active workspace
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
if (allOutputs())
return;
std::string workspaceName = payload.substr(0, payload.find(',')); std::string workspaceName = payload.substr(0, payload.find(','));
std::string monitorName = payload.substr(payload.find(',') + 1); std::string monitorName = payload.substr(payload.find(',') + 1);