Skip to content

Commit

Permalink
fix: fill persistent workspaces' windows at init
Browse files Browse the repository at this point in the history
  • Loading branch information
Syndelis committed Oct 20, 2023
1 parent 846842b commit e14a3b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/modules/hyprland/workspaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Workspaces : public AModule, public EventHandler {
{"DEFAULT", SORT_METHOD::DEFAULT}};

void fill_persistent_workspaces();
void create_persistent_workspaces();
void create_persistent_workspaces(const Json::Value& clients_data);
std::vector<std::string> persistent_workspaces_to_create_;
bool persistent_created_ = false;

Expand Down
10 changes: 5 additions & 5 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void Workspaces::fill_persistent_workspaces() {
}
}

void Workspaces::create_persistent_workspaces() {
void Workspaces::create_persistent_workspaces(const Json::Value &clients_data) {
for (const std::string &workspace_name : persistent_workspaces_to_create_) {
Json::Value new_workspace;
try {
Expand All @@ -577,7 +577,7 @@ void Workspaces::create_persistent_workspaces() {
new_workspace["windows"] = 0;
new_workspace["persistent"] = true;

create_workspace(new_workspace);
create_workspace(new_workspace, clients_data);
}
}

Expand All @@ -596,12 +596,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()) &&
Expand Down

0 comments on commit e14a3b8

Please sign in to comment.