modules/hyprland/workspaces: remove unneccesary visibleWorkspaces variable

This commit is contained in:
Austin Horstman 2024-05-28 18:52:42 -05:00
parent 1b3b45779a
commit 0055ee6910
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View File

@ -100,7 +100,7 @@ class Workspaces : public AModule, public EventHandler {
void removeWorkspacesToRemove();
void createWorkspacesToCreate();
std::vector<std::string> getVisibleWorkspaces();
void updateWorkspaceStates(const std::vector<std::string>& visibleWorkspaces);
void updateWorkspaceStates();
bool updateWindowsToCreate();
void extendOrphans(int workspaceId, Json::Value const& clientsJson);

View File

@ -128,10 +128,7 @@ void Workspaces::doUpdate() {
removeWorkspacesToRemove();
createWorkspacesToCreate();
std::vector<std::string> visibleWorkspaces = getVisibleWorkspaces();
updateWorkspaceStates(visibleWorkspaces);
updateWorkspaceStates();
updateWindowCount();
sortWorkspaces();
@ -870,7 +867,8 @@ bool Workspaces::updateWindowsToCreate() {
return anyWindowCreated;
}
void Workspaces::updateWorkspaceStates(const std::vector<std::string> &visibleWorkspaces) {
void Workspaces::updateWorkspaceStates() {
const std::vector<std::string> visibleWorkspaces = getVisibleWorkspaces();
auto updatedWorkspaces = gIPC->getSocket1JsonReply("workspaces");
for (auto &workspace : m_workspaces) {
workspace->setActive(workspace->name() == m_activeWorkspaceName ||