@@ -17,6 +17,7 @@
1717#include "WorkspaceModel.h"
1818#include "WorkspaceManager.h"
1919#include "Workspace.h"
20+#include "Screen.h"
2021
2122#include <QQmlEngine>
2223
@@ -119,11 +120,6 @@ QVariant WorkspaceModel::data(const QModelIndex &index, int role) const
119120 }
120121}
121122
122−void WorkspaceModel::setSyncing(bool syncing)
123−{
124− m_syncing = syncing;
125−}
126−
127123void WorkspaceModel::sync(WorkspaceModel *proxy)
128124{
129125 if (!proxy) return;
@@ -206,8 +202,9 @@ void WorkspaceModel::insertUnassigned(Workspace *workspace)
206202}
207203
208204
209−ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
205+ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model, ProxyScreen* screen)
210206 : m_original(model)
207+ , m_screen(screen)
211208{
212209 Q_FOREACH(auto workspace, model->list()) {
213210 auto proxy = new ProxyWorkspace(workspace);
@@ -215,12 +212,12 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
215212 proxy->assign(this);
216213 }
217214 connect(m_original, &WorkspaceModel::workspaceInserted, this, [this](int index, Workspace* inserted) {
218− if (m_original->isSyncing()) return;
215+ if (isSyncing()) return;
219216
220217 (new ProxyWorkspace(inserted))->assign(this, index);
221218 });
222219 connect(m_original, &WorkspaceModel::workspaceRemoved, this, [this](Workspace* removed) {
223− if (m_original->isSyncing()) return;
220+ if (isSyncing()) return;
224221
225222 for (int i = 0; i < rowCount(); i++) {
226223 auto workspaceProxy = qobject_cast<ProxyWorkspace*>(get(i));
@@ -232,7 +229,7 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
232229 }
233230 });
234231 connect(m_original, &WorkspaceModel::workspaceMoved, this, [this](int from, int to) {
235− if (m_original->isSyncing()) return;
232+ if (isSyncing()) return;
236233
237234 move(from, to);
238235 });
@@ -243,6 +240,11 @@ void ProxyWorkspaceModel::move(int from, int to)
243240 WorkspaceModel::move(from, to);
244241}
245242
243+bool ProxyWorkspaceModel::isSyncing() const
244+{
245+ return m_screen->isSyncing();
246+}
247+
246248void ProxyWorkspaceModel::addWorkspace()
247249{
248250 auto newWorkspace = WorkspaceManager::instance()->createWorkspace();