[hyprland/workspaces] Update window count and sort workspaces AFTER their creation

master
Tom Benham 2024-04-12 11:35:41 +02:00
parent cd3d588abd
commit 084b561d5b
1 changed files with 5 additions and 4 deletions

View File

@ -194,6 +194,10 @@ void Workspaces::doUpdate() {
for (auto &[workspaceData, clientsData] : m_workspacesToCreate) { for (auto &[workspaceData, clientsData] : m_workspacesToCreate) {
createWorkspace(workspaceData, clientsData); createWorkspace(workspaceData, clientsData);
} }
if (!m_workspacesToCreate.empty()) {
updateWindowCount();
sortWorkspaces();
}
m_workspacesToCreate.clear(); m_workspacesToCreate.clear();
// get all active workspaces // get all active workspaces
@ -391,8 +395,7 @@ void Workspaces::onWorkspaceMoved(std::string const &payload) {
// Update active workspace // Update active workspace
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString(); m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
if (allOutputs()) if (allOutputs()) return;
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);
@ -833,8 +836,6 @@ void Workspaces::init() {
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString(); m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
initializeWorkspaces(); initializeWorkspaces();
updateWindowCount();
sortWorkspaces();
dp.emit(); dp.emit();
} }