diff --git a/include/modules/hyprland/workspaces.hpp b/include/modules/hyprland/workspaces.hpp index 6a0c2634..dde564df 100644 --- a/include/modules/hyprland/workspaces.hpp +++ b/include/modules/hyprland/workspaces.hpp @@ -161,7 +161,7 @@ class Workspaces : public AModule, public EventHandler { {"DEFAULT", SORT_METHOD::DEFAULT}}; void fill_persistent_workspaces(); - void create_persistent_workspaces(const Json::Value& clients_data); + void create_persistent_workspaces(); std::vector persistent_workspaces_to_create_; bool persistent_created_ = false; diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index 6ffdf237..42e112d2 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -555,7 +555,7 @@ void Workspaces::fill_persistent_workspaces() { } } -void Workspaces::create_persistent_workspaces(const Json::Value &clients_data) { +void Workspaces::create_persistent_workspaces() { for (const std::string &workspace_name : persistent_workspaces_to_create_) { Json::Value new_workspace; try { @@ -570,7 +570,7 @@ void Workspaces::create_persistent_workspaces(const Json::Value &clients_data) { new_workspace["windows"] = 0; new_workspace["persistent"] = true; - create_workspace(new_workspace, clients_data); + create_workspace(new_workspace); } } @@ -589,12 +589,12 @@ void Workspaces::init() { monitor_id_ = (*current_monitor)["id"].asInt(); } + fill_persistent_workspaces(); + create_persistent_workspaces(); + const Json::Value workspaces_json = gIPC->getSocket1JsonReply("workspaces"); const Json::Value clients_json = gIPC->getSocket1JsonReply("clients"); - fill_persistent_workspaces(); - create_persistent_workspaces(clients_json); - for (Json::Value workspace_json : workspaces_json) { std::string workspace_name = workspace_json["name"].asString(); if ((all_outputs() || bar_.output->name == workspace_json["monitor"].asString()) &&