Minor code cleanup

This commit is contained in:
Pol Rivero
2025-05-02 14:29:27 +02:00
parent 61c5dad895
commit c9215ad818
2 changed files with 6 additions and 17 deletions

View File

@ -595,21 +595,13 @@ void Workspaces::onActiveWindowChanged(WindowAddress const &activeWindowAddress)
m_currentActiveWindowAddress = activeWindowAddress;
for (auto &[address, window] : m_orphanWindowMap) {
if (address == activeWindowAddress) {
window.setActive(true);
} else {
window.setActive(false);
}
window.setActive(address == activeWindowAddress);
}
for (auto const &workspace : m_workspaces) {
workspace->setActiveWindow(activeWindowAddress);
}
for (auto &window : m_windowsToCreate) {
if (window.getAddress() == activeWindowAddress) {
window.setActive(true);
} else {
window.setActive(false);
}
window.setActive(window.getAddress() == activeWindowAddress);
}
}
@ -953,7 +945,7 @@ auto Workspaces::update() -> void {
void Workspaces::updateWindowCount() {
const Json::Value workspacesJson = m_ipc.getSocket1JsonReply("workspaces");
for (auto &workspace : m_workspaces) {
for (auto const &workspace : m_workspaces) {
auto workspaceJson = std::ranges::find_if(workspacesJson, [&](Json::Value const &x) {
return x["name"].asString() == workspace->name() ||
(workspace->isSpecial() && x["name"].asString() == "special:" + workspace->name());