Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed variable synchronization exception caused by the "hyprland/workspace" module #2613

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,25 @@ auto Workspaces::register_ipc() -> void {
}

auto Workspaces::update() -> void {
//remove workspaces that wait to be removed
unsigned int current_remove_workspace_num = 0;
for (const std::string &workspace_to_remove : workspaces_to_remove_) {
remove_workspace(workspace_to_remove);
current_remove_workspace_num++;
}
for (unsigned int i = 0; i < current_remove_workspace_num; i++) {
workspaces_to_remove_.erase(workspaces_to_remove_.begin());
}

workspaces_to_remove_.clear();

//add workspaces that wait to be created
unsigned int current_create_workspace_num = 0;
for (Json::Value const &workspace_to_create : workspaces_to_create_) {
create_workspace(workspace_to_create);
current_create_workspace_num++;
}
for (unsigned int i = 0; i < current_create_workspace_num; i++) {
workspaces_to_create_.erase(workspaces_to_create_.begin());
}

workspaces_to_create_.clear();

// get all active workspaces
auto monitors = gIPC->getSocket1JsonReply("monitors");
Expand Down