| 127 | } |
| 128 | |
| 129 | void Workspace::insertWindow(WindowCreationPayload create_window_payload) { |
| 130 | if (!create_window_payload.isEmpty(m_workspaceManager)) { |
| 131 | auto repr = create_window_payload.repr(m_workspaceManager); |
| 132 | |
| 133 | if (!repr.empty() || m_workspaceManager.enableTaskbar()) { |
| 134 | auto addr = create_window_payload.getAddress(); |
| 135 | auto it = std::ranges::find_if( |
| 136 | m_windowMap, [&addr](const auto& window) { return window.address == addr; }); |
| 137 | // If the vector contains the address, update the window representation, otherwise insert it |
| 138 | if (it != m_windowMap.end()) { |
| 139 | *it = repr; |
| 140 | } else { |
| 141 | m_windowMap.emplace_back(repr); |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | }; |
| 146 | |
| 147 | bool Workspace::onWindowOpened(WindowCreationPayload const& create_window_payload) { |
| 148 | if (create_window_payload.getWorkspaceName() == name()) { |
no test coverage detected