From 0055ee69102441558bc8e72348c689540221dc57 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 28 May 2024 18:52:42 -0500 Subject: [PATCH] modules/hyprland/workspaces: remove unneccesary visibleWorkspaces variable --- include/modules/hyprland/workspaces.hpp | 2 +- src/modules/hyprland/workspaces.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/modules/hyprland/workspaces.hpp b/include/modules/hyprland/workspaces.hpp index 0432b870..6c6e0932 100644 --- a/include/modules/hyprland/workspaces.hpp +++ b/include/modules/hyprland/workspaces.hpp @@ -100,7 +100,7 @@ class Workspaces : public AModule, public EventHandler { void removeWorkspacesToRemove(); void createWorkspacesToCreate(); std::vector getVisibleWorkspaces(); - void updateWorkspaceStates(const std::vector& visibleWorkspaces); + void updateWorkspaceStates(); bool updateWindowsToCreate(); void extendOrphans(int workspaceId, Json::Value const& clientsJson); diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index 3b129375..3209243c 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -128,10 +128,7 @@ void Workspaces::doUpdate() { removeWorkspacesToRemove(); createWorkspacesToCreate(); - - std::vector visibleWorkspaces = getVisibleWorkspaces(); - - updateWorkspaceStates(visibleWorkspaces); + updateWorkspaceStates(); updateWindowCount(); sortWorkspaces(); @@ -870,7 +867,8 @@ bool Workspaces::updateWindowsToCreate() { return anyWindowCreated; } -void Workspaces::updateWorkspaceStates(const std::vector &visibleWorkspaces) { +void Workspaces::updateWorkspaceStates() { + const std::vector visibleWorkspaces = getVisibleWorkspaces(); auto updatedWorkspaces = gIPC->getSocket1JsonReply("workspaces"); for (auto &workspace : m_workspaces) { workspace->setActive(workspace->name() == m_activeWorkspaceName ||