* Workspaces::doUpdate - update workspaces in UI thread. * * Note: some memberfields are modified by both UI thread and event listener thread, use m_mutex to * protect these member fields, and lock should released before calling AModule::update(). */
| 124 | * protect these member fields, and lock should released before calling AModule::update(). |
| 125 | */ |
| 126 | void Workspaces::doUpdate() { |
| 127 | std::unique_lock lock(m_mutex); |
| 128 | |
| 129 | removeWorkspacesToRemove(); |
| 130 | createWorkspacesToCreate(); |
| 131 | updateWorkspaceStates(); |
| 132 | updateWindowCount(); |
| 133 | sortWorkspaces(); |
| 134 | |
| 135 | bool anyWindowCreated = updateWindowsToCreate(); |
| 136 | |
| 137 | if (anyWindowCreated) { |
| 138 | dp.emit(); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | void Workspaces::extendOrphans(int workspaceId, Json::Value const& clientsJson) { |
| 143 | spdlog::trace("Extending orphans with workspace {}", workspaceId); |