on xenial help sign in
merged with pre-req
c403943Nick Dedekind
plugins/WindowManager/Screen.cpp+8−7
@@ -185,11 +185,6 @@ QString Screen::outputTypeName() const
185 return QString();
185 return QString();
186}
186}
187
187
188−void Screen::setSyncing(bool syncing)
189−{
190− workspaces()->setSyncing(syncing);
191−}
192−
193void Screen::sync(Screen *proxy)
188void Screen::sync(Screen *proxy)
194{
189{
195 if (!proxy) return;
190 if (!proxy) return;
@@ -258,9 +253,10 @@ void ConcreteScreen::setCurrentWorkspace(Workspace *workspace)
258 }
253 }
259}
254}
260
255
261−ProxyScreen::ProxyScreen(Screen *const screen)
256+ProxyScreen::ProxyScreen(Screen *const screen, ProxyScreens* screens)
262− : m_workspaces(new ProxyWorkspaceModel(screen->workspaces()))
257+ : m_workspaces(new ProxyWorkspaceModel(screen->workspaces(), this))
263 , m_original(screen)
258 , m_original(screen)
259+ , m_screens(screens)
264{
260{
265 connectToScreen(screen);
261 connectToScreen(screen);
266
262
@@ -296,3 +292,8 @@ void ProxyScreen::setCurrentWorkspace(Workspace *workspace)
296 m_original->setCurrentWorkspace(p->proxyObject());
292 m_original->setCurrentWorkspace(p->proxyObject());
297 }
293 }
298}
294}
295+
296+bool ProxyScreen::isSyncing() const
297+{
298+ return m_screens->isSyncing();
299+}
plugins/WindowManager/Screen.h+5−5
@@ -8,7 +8,7 @@
8#include "WorkspaceModel.h"
8#include "WorkspaceModel.h"
9
9
10class ProxyScreen;
10class ProxyScreen;
11−class ScreenAttached;
11+class ProxyScreens;
12
12
13class Screen: public QObject
13class Screen: public QObject
14{
14{
@@ -55,7 +55,6 @@ public:
55 virtual Workspace *currentWorkspace() const = 0;
55 virtual Workspace *currentWorkspace() const = 0;
56 virtual void setCurrentWorkspace(Workspace* workspace) = 0;
56 virtual void setCurrentWorkspace(Workspace* workspace) = 0;
57
57
58− void setSyncing(bool);
59 void sync(Screen* proxy);
58 void sync(Screen* proxy);
60
59
61 qtmir::Screen* wrapped() const { return m_wrapped; }
60 qtmir::Screen* wrapped() const { return m_wrapped; }
@@ -101,8 +100,6 @@ public:
101 Workspace *currentWorkspace() const override;
100 Workspace *currentWorkspace() const override;
102 void setCurrentWorkspace(Workspace* workspace) override;
101 void setCurrentWorkspace(Workspace* workspace) override;
103
102
104− static ScreenAttached *qmlAttachedProperties(QObject *owner);
105−
106protected:
103protected:
107 void resetCurrentWorkspace();
104 void resetCurrentWorkspace();
108
105
@@ -114,7 +111,7 @@ class ProxyScreen : public Screen
114{
111{
115 Q_OBJECT
112 Q_OBJECT
116public:
113public:
117− explicit ProxyScreen(Screen*const screen);
114+ explicit ProxyScreen(Screen*const screen, ProxyScreens* screens);
118
115
119 // From qtmir::Screen
116 // From qtmir::Screen
120 WorkspaceModel* workspaces() const override;
117 WorkspaceModel* workspaces() const override;
@@ -123,9 +120,12 @@ public:
123
120
124 Screen* proxyObject() const { return m_original.data(); }
121 Screen* proxyObject() const { return m_original.data(); }
125
122
123+ bool isSyncing() const;
124+
126private:
125private:
127 const QScopedPointer<WorkspaceModel> m_workspaces;
126 const QScopedPointer<WorkspaceModel> m_workspaces;
128 const QPointer<Screen> m_original;
127 const QPointer<Screen> m_original;
128+ const ProxyScreens* m_screens;
129 QPointer<Workspace> m_currentWorspace;
129 QPointer<Workspace> m_currentWorspace;
130};
130};
131
131
plugins/WindowManager/Screens.cpp+12−11
@@ -137,22 +137,17 @@ ProxyScreens *ConcreteScreens::createProxy()
137 return new ProxyScreens(this);
137 return new ProxyScreens(this);
138}
138}
139
139
140−void ConcreteScreens::sync(Screens *proxy)
140+void ConcreteScreens::sync(ProxyScreens *proxy)
141{
141{
142 if (!proxy) return;
142 if (!proxy) return;
143−
144− for (auto screen : m_screens) {
145− screen->setSyncing(true);
143+ proxy->setSyncing(true);
146− }
147
144
148 const auto& proxyList = proxy->list();
145 const auto& proxyList = proxy->list();
149 for (int i = 0; i < m_screens.count() && i < proxyList.count(); ++i) {
146 for (int i = 0; i < m_screens.count() && i < proxyList.count(); ++i) {
150 m_screens[i]->sync(proxyList[i]);
147 m_screens[i]->sync(proxyList[i]);
151 }
148 }
152
149
153− for (auto screen : m_screens) {
154− screen->setSyncing(false);
150+ proxy->setSyncing(true);
155− }
156}
151}
157
152
158void ConcreteScreens::onScreenAdded(qtmir::Screen *added)
153void ConcreteScreens::onScreenAdded(qtmir::Screen *added)
@@ -199,6 +194,7 @@ void ConcreteScreens::onScreenRemoved(qtmir::Screen *removed)
199ProxyScreens::ProxyScreens(Screens * const screens)
194ProxyScreens::ProxyScreens(Screens * const screens)
200 : Screens(screens->m_wrapped)
195 : Screens(screens->m_wrapped)
201 , m_original(screens)
196 , m_original(screens)
197+ , m_syncing(false)
202{
198{
203 connect(screens, &Screens::screenAdded, this, [this](Screen *added) {
199 connect(screens, &Screens::screenAdded, this, [this](Screen *added) {
204 Q_FOREACH(auto screen, m_screens) {
200 Q_FOREACH(auto screen, m_screens) {
@@ -207,7 +203,7 @@ ProxyScreens::ProxyScreens(Screens * const screens)
207 }
203 }
208
204
209 beginInsertRows(QModelIndex(), count(), count());
205 beginInsertRows(QModelIndex(), count(), count());
210− auto screenWrapper(new ProxyScreen(added));
206+ auto screenWrapper(new ProxyScreen(added, this));
211 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
207 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
212 m_screens.push_back(screenWrapper);
208 m_screens.push_back(screenWrapper);
213 endInsertRows();
209 endInsertRows();
@@ -237,8 +233,13 @@ ProxyScreens::ProxyScreens(Screens * const screens)
237 });
233 });
238
234
239 Q_FOREACH(Screen* screen, screens->list()) {
235 Q_FOREACH(Screen* screen, screens->list()) {
240− auto screenWrapper(new ProxyScreen(screen));
236+ auto screenWrapper(new ProxyScreen(screen, this));
241 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
237 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
242− m_screens.push_back(new ProxyScreen(screen));
238+ m_screens.push_back(screenWrapper);
243 }
239 }
244}
240}
241+
242+void ProxyScreens::setSyncing(bool syncing)
243+{
244+ m_syncing = syncing;
245+}
plugins/WindowManager/Screens.h+5−4
@@ -55,8 +55,6 @@ public:
55 int count() const;
55 int count() const;
56 QVariant activeScreen() const;
56 QVariant activeScreen() const;
57
57
58− bool isSyncing() const { return m_syncing; }
59−
60 const QVector<Screen*>& list() const { return m_screens; }
58 const QVector<Screen*>& list() const { return m_screens; }
61
59
62public Q_SLOTS:
60public Q_SLOTS:
@@ -74,7 +72,6 @@ protected:
74
72
75 QVector<Screen*> m_screens;
73 QVector<Screen*> m_screens;
76 const QSharedPointer<qtmir::Screens> m_wrapped;
74 const QSharedPointer<qtmir::Screens> m_wrapped;
77− bool m_syncing;
78
75
79 friend class ProxyScreens;
76 friend class ProxyScreens;
80};
77};
@@ -87,7 +84,7 @@ public:
87 ~ConcreteScreens();
84 ~ConcreteScreens();
88
85
89 Q_INVOKABLE ProxyScreens *createProxy();
86 Q_INVOKABLE ProxyScreens *createProxy();
90− Q_INVOKABLE void sync(Screens *proxy);
87+ Q_INVOKABLE void sync(ProxyScreens *proxy);
91
88
92 static ConcreteScreens *self();
89 static ConcreteScreens *self();
93
90
@@ -106,8 +103,12 @@ class ProxyScreens : public Screens
106public:
103public:
107 explicit ProxyScreens(Screens*const screens);
104 explicit ProxyScreens(Screens*const screens);
108
105
106+ void setSyncing(bool syncing);
107+ bool isSyncing() const { return m_syncing; }
108+
109private:
109private:
110 const QPointer<Screens> m_original;
110 const QPointer<Screens> m_original;
111+ bool m_syncing;
111};
112};
112
113
113#endif // SCREENS_H
114#endif // SCREENS_H
plugins/WindowManager/WorkspaceModel.cpp+11−9
@@ -17,6 +17,7 @@
17#include "WorkspaceModel.h"
17#include "WorkspaceModel.h"
18#include "WorkspaceManager.h"
18#include "WorkspaceManager.h"
19#include "Workspace.h"
19#include "Workspace.h"
20+#include "Screen.h"
20
21
21#include <QQmlEngine>
22#include <QQmlEngine>
22
23
@@ -119,11 +120,6 @@ QVariant WorkspaceModel::data(const QModelIndex &index, int role) const
119 }
120 }
120}
121}
121
122
122−void WorkspaceModel::setSyncing(bool syncing)
123−{
124− m_syncing = syncing;
125−}
126−
127void WorkspaceModel::sync(WorkspaceModel *proxy)
123void WorkspaceModel::sync(WorkspaceModel *proxy)
128{
124{
129 if (!proxy) return;
125 if (!proxy) return;
@@ -206,8 +202,9 @@ void WorkspaceModel::insertUnassigned(Workspace *workspace)
206}
202}
207
203
208
204
209−ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
205+ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model, ProxyScreen* screen)
210 : m_original(model)
206 : m_original(model)
207+ , m_screen(screen)
211{
208{
212 Q_FOREACH(auto workspace, model->list()) {
209 Q_FOREACH(auto workspace, model->list()) {
213 auto proxy = new ProxyWorkspace(workspace);
210 auto proxy = new ProxyWorkspace(workspace);
@@ -215,12 +212,12 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
215 proxy->assign(this);
212 proxy->assign(this);
216 }
213 }
217 connect(m_original, &WorkspaceModel::workspaceInserted, this, [this](int index, Workspace* inserted) {
214 connect(m_original, &WorkspaceModel::workspaceInserted, this, [this](int index, Workspace* inserted) {
218− if (m_original->isSyncing()) return;
215+ if (isSyncing()) return;
219
216
220 (new ProxyWorkspace(inserted))->assign(this, index);
217 (new ProxyWorkspace(inserted))->assign(this, index);
221 });
218 });
222 connect(m_original, &WorkspaceModel::workspaceRemoved, this, [this](Workspace* removed) {
219 connect(m_original, &WorkspaceModel::workspaceRemoved, this, [this](Workspace* removed) {
223− if (m_original->isSyncing()) return;
220+ if (isSyncing()) return;
224
221
225 for (int i = 0; i < rowCount(); i++) {
222 for (int i = 0; i < rowCount(); i++) {
226 auto workspaceProxy = qobject_cast<ProxyWorkspace*>(get(i));
223 auto workspaceProxy = qobject_cast<ProxyWorkspace*>(get(i));
@@ -232,7 +229,7 @@ ProxyWorkspaceModel::ProxyWorkspaceModel(WorkspaceModel * const model)
232 }
229 }
233 });
230 });
234 connect(m_original, &WorkspaceModel::workspaceMoved, this, [this](int from, int to) {
231 connect(m_original, &WorkspaceModel::workspaceMoved, this, [this](int from, int to) {
235− if (m_original->isSyncing()) return;
232+ if (isSyncing()) return;
236
233
237 move(from, to);
234 move(from, to);
238 });
235 });
@@ -243,6 +240,11 @@ void ProxyWorkspaceModel::move(int from, int to)
243 WorkspaceModel::move(from, to);
240 WorkspaceModel::move(from, to);
244}
241}
245
242
243+bool ProxyWorkspaceModel::isSyncing() const
244+{
245+ return m_screen->isSyncing();
246+}
247+
246void ProxyWorkspaceModel::addWorkspace()
248void ProxyWorkspaceModel::addWorkspace()
247{
249{
248 auto newWorkspace = WorkspaceManager::instance()->createWorkspace();
250 auto newWorkspace = WorkspaceManager::instance()->createWorkspace();
plugins/WindowManager/WorkspaceModel.h+5−5
@@ -25,6 +25,7 @@ Q_DECLARE_LOGGING_CATEGORY(WORKSPACES)
25
25
26class Workspace;
26class Workspace;
27class ProxyWorkspaceModel;
27class ProxyWorkspaceModel;
28+class ProxyScreen;
28
29
29class WorkspaceModel : public QAbstractListModel
30class WorkspaceModel : public QAbstractListModel
30{
31{
@@ -61,12 +62,9 @@ public:
61
62
62 const QVector<Workspace*>& list() const { return m_workspaces; }
63 const QVector<Workspace*>& list() const { return m_workspaces; }
63
64
64− void setSyncing(bool);
65 void sync(WorkspaceModel* proxy);
65 void sync(WorkspaceModel* proxy);
66 void finishSync();
66 void finishSync();
67
67
68− bool isSyncing() { return m_syncing; }
69−
70Q_SIGNALS:
68Q_SIGNALS:
71 void countChanged();
69 void countChanged();
72
70
@@ -79,7 +77,6 @@ protected:
79
77
80 QVector<Workspace*> m_workspaces;
78 QVector<Workspace*> m_workspaces;
81 QSet<Workspace*> m_unassignedWorkspaces;
79 QSet<Workspace*> m_unassignedWorkspaces;
82− bool m_syncing;
83
80
84 friend class ProxyWorkspaceModel;
81 friend class ProxyWorkspaceModel;
85};
82};
@@ -88,15 +85,18 @@ class ProxyWorkspaceModel : public WorkspaceModel
88{
85{
89 Q_OBJECT
86 Q_OBJECT
90public:
87public:
91− explicit ProxyWorkspaceModel(WorkspaceModel*const model);
88+ explicit ProxyWorkspaceModel(WorkspaceModel*const model, ProxyScreen* screen);
92
89
93 Q_INVOKABLE void move(int from, int to) override;
90 Q_INVOKABLE void move(int from, int to) override;
94
91
92+ bool isSyncing() const;
93+
95public Q_SLOTS:
94public Q_SLOTS:
96 void addWorkspace();
95 void addWorkspace();
97
96
98protected:
97protected:
99 const QPointer<WorkspaceModel> m_original;
98 const QPointer<WorkspaceModel> m_original;
99+ const ProxyScreen* m_screen;
100};
100};
101
101
102#endif // WORKSPACEMODEL_H
102#endif // WORKSPACEMODEL_H
tests/qmltests/Stage/tst_PhoneStage.qml+4−5
@@ -31,6 +31,8 @@ Item {
31
31
32 property var greeter: { fullyShown: true }
32 property var greeter: { fullyShown: true }
33
33
34+ readonly property var topLevelSurfaceList: WorkspaceManager.activeWorkspace.windowModel
35+
34 ApplicationMenuDataLoader {
36 ApplicationMenuDataLoader {
35 id: appMenuData
37 id: appMenuData
36 }
38 }
@@ -45,11 +47,8 @@ Item {
45 orientations: Orientations {}
47 orientations: Orientations {}
46 applicationManager: ApplicationManager
48 applicationManager: ApplicationManager
47 mode: "staged"
49 mode: "staged"
48− topLevelSurfaceList: TopLevelWindowModel {
49− id: topLevelSurfaceList
50+ topLevelSurfaceList: root.topLevelSurfaceList
50− applicationManager: ApplicationManager
51+
51− surfaceManager: SurfaceManager
52− }
53 Component.onCompleted: {
52 Component.onCompleted: {
54 ApplicationManager.startApplication("unity8-dash");
53 ApplicationManager.startApplication("unity8-dash");
55 }
54 }
tests/qmltests/Stage/tst_TabletStage.qml+41−41
@@ -35,6 +35,8 @@ Rectangle {
35
35
36 property var greeter: { fullyShown: true }
36 property var greeter: { fullyShown: true }
37
37
38+ readonly property var topLevelSurfaceList: WorkspaceManager.activeWorkspace.windowModel
39+
38 ApplicationMenuDataLoader {
40 ApplicationMenuDataLoader {
39 id: appMenuData
41 id: appMenuData
40 }
42 }
@@ -54,12 +56,10 @@ Rectangle {
54 focus: true
56 focus: true
55 mode: "stagedWithSideStage"
57 mode: "stagedWithSideStage"
56 applicationManager: ApplicationManager
58 applicationManager: ApplicationManager
57− topLevelSurfaceList: TopLevelWindowModel {
58− id: topLevelSurfaceList
59+ topLevelSurfaceList: root.topLevelSurfaceList
59− applicationManager: ApplicationManager
60+
60− surfaceManager: SurfaceManager
61− }
62 Component.onCompleted: {
61 Component.onCompleted: {
62+ print("starting dash")
63 ApplicationManager.startApplication("unity8-dash");
63 ApplicationManager.startApplication("unity8-dash");
64 }
64 }
65 }
65 }
@@ -131,21 +131,21 @@ Rectangle {
131 name: "TabletStage"
131 name: "TabletStage"
132 when: windowShown
132 when: windowShown
133
133
134− readonly property alias topSurfaceList: stage.topLevelSurfaceList
134+ readonly property alias topLevelSurfaceList: root.topLevelSurfaceList
135 property Item sideStage: stage ? findChild(stage, "sideStage") : null
135 property Item sideStage: stage ? findChild(stage, "sideStage") : null
136
136
137 function init() {
137 function init() {
138 stageSaver.clear();
138 stageSaver.clear();
139
139
140 ApplicationManager.startApplication("unity8-dash");
140 ApplicationManager.startApplication("unity8-dash");
141− tryCompare(topSurfaceList, "count", 1);
141+ tryCompare(topLevelSurfaceList, "count", 1);
142− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
142+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
143
143
144 // this is very strange, but sometimes the test starts without
144 // this is very strange, but sometimes the test starts without
145 // Stage components having finished loading themselves
145 // Stage components having finished loading themselves
146 var appWindow = null
146 var appWindow = null
147 while (!appWindow) {
147 while (!appWindow) {
148− appWindow = findAppWindowForSurfaceId(topSurfaceList.idAt(0));
148+ appWindow = findAppWindowForSurfaceId(topLevelSurfaceList.idAt(0));
149 if (!appWindow) {
149 if (!appWindow) {
150 console.log("didn't find unity8-dash appWindow in Stage. Trying again...");
150 console.log("didn't find unity8-dash appWindow in Stage. Trying again...");
151 wait(50);
151 wait(50);
@@ -157,7 +157,7 @@ Rectangle {
157 tryCompare(appRepeater, "count", 1);
157 tryCompare(appRepeater, "count", 1);
158 tryCompare(appRepeater.itemAt(0), "x", 0);
158 tryCompare(appRepeater.itemAt(0), "x", 0);
159
159
160− waitUntilAppSurfaceShowsUp(topSurfaceList.idAt(0));
160+ waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0));
161 sideStage.hideNow()
161 sideStage.hideNow()
162 tryCompare(sideStage, "x", stage.width)
162 tryCompare(sideStage, "x", stage.width)
163 }
163 }
@@ -272,7 +272,7 @@ Rectangle {
272 function test_tappingSwitchesFocusBetweenStages() {
272 function test_tappingSwitchesFocusBetweenStages() {
273 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
273 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
274
274
275− var webbrowserSurfaceId = topSurfaceList.nextId;
275+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
276 webbrowserCheckBox.checked = true;
276 webbrowserCheckBox.checked = true;
277 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
277 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
278 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
278 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
@@ -283,7 +283,7 @@ Rectangle {
283
283
284 tryCompare(webbrowserWindow.surface, "activeFocus", true);
284 tryCompare(webbrowserWindow.surface, "activeFocus", true);
285
285
286− var dialerSurfaceId = topSurfaceList.nextId;
286+ var dialerSurfaceId = topLevelSurfaceList.nextId;
287 dialerCheckBox.checked = true;
287 dialerCheckBox.checked = true;
288 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
288 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
289
289
@@ -315,7 +315,7 @@ Rectangle {
315 function test_closeAppInSideStage() {
315 function test_closeAppInSideStage() {
316 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
316 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
317
317
318− var dialerSurfaceId = topSurfaceList.nextId;
318+ var dialerSurfaceId = topLevelSurfaceList.nextId;
319 dialerCheckBox.checked = true;
319 dialerCheckBox.checked = true;
320 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
320 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
321
321
@@ -341,7 +341,7 @@ Rectangle {
341 }
341 }
342
342
343 function test_suspendsAndResumesAppsInMainStage() {
343 function test_suspendsAndResumesAppsInMainStage() {
344− var webbrowserSurfaceId = topSurfaceList.nextId;
344+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
345 webbrowserCheckBox.checked = true;
345 webbrowserCheckBox.checked = true;
346 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
346 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
347 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
347 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
@@ -350,7 +350,7 @@ Rectangle {
350
350
351 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
351 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
352
352
353− var gallerySurfaceId = topSurfaceList.nextId;
353+ var gallerySurfaceId = topLevelSurfaceList.nextId;
354 galleryCheckBox.checked = true;
354 galleryCheckBox.checked = true;
355 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
355 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
356 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
356 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
@@ -381,7 +381,7 @@ Rectangle {
381 // launch two main stage apps
381 // launch two main stage apps
382 // gallery will be on foreground and webbrowser on background
382 // gallery will be on foreground and webbrowser on background
383
383
384− var webbrowserSurfaceId = topSurfaceList.nextId;
384+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
385 webbrowserCheckBox.checked = true;
385 webbrowserCheckBox.checked = true;
386 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
386 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
387 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
387 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
@@ -389,7 +389,7 @@ Rectangle {
389 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
389 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
390 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
390 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
391
391
392− var gallerySurfaceId = topSurfaceList.nextId;
392+ var gallerySurfaceId = topLevelSurfaceList.nextId;
393 galleryCheckBox.checked = true;
393 galleryCheckBox.checked = true;
394 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
394 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
395 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
395 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
@@ -401,14 +401,14 @@ Rectangle {
401 // then launch two side stage apps
401 // then launch two side stage apps
402 // facebook will be on foreground and dialer on background
402 // facebook will be on foreground and dialer on background
403
403
404− var dialerSurfaceId = topSurfaceList.nextId;
404+ var dialerSurfaceId = topLevelSurfaceList.nextId;
405 dialerCheckBox.checked = true;
405 dialerCheckBox.checked = true;
406 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
406 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
407 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
407 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
408 var dialerDelegate = findChild(stage, "appDelegate_" + dialerSurfaceId);
408 var dialerDelegate = findChild(stage, "appDelegate_" + dialerSurfaceId);
409 compare(dialerDelegate.stage, ApplicationInfoInterface.SideStage);
409 compare(dialerDelegate.stage, ApplicationInfoInterface.SideStage);
410
410
411− var facebookSurfaceId = topSurfaceList.nextId;
411+ var facebookSurfaceId = topLevelSurfaceList.nextId;
412 facebookCheckBox.checked = true;
412 facebookCheckBox.checked = true;
413 waitUntilAppSurfaceShowsUp(facebookSurfaceId);
413 waitUntilAppSurfaceShowsUp(facebookSurfaceId);
414 var facebookApp = ApplicationManager.findApplication(facebookCheckBox.appId);
414 var facebookApp = ApplicationManager.findApplication(facebookCheckBox.appId);
@@ -443,14 +443,14 @@ Rectangle {
443 function test_foregroundAppsAreSuspendedWhenStageIsSuspended() {
443 function test_foregroundAppsAreSuspendedWhenStageIsSuspended() {
444 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
444 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
445
445
446− var webbrowserSurfaceId = topSurfaceList.nextId;
446+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
447 webbrowserCheckBox.checked = true;
447 webbrowserCheckBox.checked = true;
448 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
448 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
449 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
449 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
450 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
450 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
451 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
451 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
452
452
453− var dialerSurfaceId = topSurfaceList.nextId;
453+ var dialerSurfaceId = topLevelSurfaceList.nextId;
454 dialerCheckBox.checked = true;
454 dialerCheckBox.checked = true;
455 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
455 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
456 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
456 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
@@ -524,7 +524,7 @@ Rectangle {
524 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
524 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
525 tryCompare(stagesPriv, "sideStageAppId", "");
525 tryCompare(stagesPriv, "sideStageAppId", "");
526
526
527− var appSurfaceId = topSurfaceList.nextId;
527+ var appSurfaceId = topLevelSurfaceList.nextId;
528 var app = ApplicationManager.startApplication(data.appId);
528 var app = ApplicationManager.startApplication(data.appId);
529 waitUntilAppSurfaceShowsUp(appSurfaceId);
529 waitUntilAppSurfaceShowsUp(appSurfaceId);
530
530
@@ -548,7 +548,7 @@ Rectangle {
548 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
548 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
549 tryCompare(stagesPriv, "sideStageAppId", "");
549 tryCompare(stagesPriv, "sideStageAppId", "");
550
550
551− var webbrowserSurfaceId = topSurfaceList.nextId;
551+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
552 webbrowserCheckBox.checked = true;
552 webbrowserCheckBox.checked = true;
553 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
553 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
554
554
@@ -573,7 +573,7 @@ Rectangle {
573 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
573 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
574 tryCompare(stagesPriv, "sideStageAppId", "");
574 tryCompare(stagesPriv, "sideStageAppId", "");
575
575
576− var webbrowserSurfaceId = topSurfaceList.nextId;
576+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
577 webbrowserCheckBox.checked = true;
577 webbrowserCheckBox.checked = true;
578 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
578 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
579
579
@@ -591,7 +591,7 @@ Rectangle {
591 function test_loadSideStageByDraggingFromMainStage() {
591 function test_loadSideStageByDraggingFromMainStage() {
592 sideStage.showNow();
592 sideStage.showNow();
593 print("sidestage now shown. launching browser")
593 print("sidestage now shown. launching browser")
594− var webbrowserSurfaceId = topSurfaceList.nextId;
594+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
595 webbrowserCheckBox.checked = true;
595 webbrowserCheckBox.checked = true;
596 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
596 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
597
597
@@ -612,7 +612,7 @@ Rectangle {
612 tryCompareFunction(function() {
612 tryCompareFunction(function() {
613 return WindowStateStorage.getStage(webbrowserCheckBox.appId, ApplicationInfoInterface.MainStage) === ApplicationInfoInterface.SideStage
613 return WindowStateStorage.getStage(webbrowserCheckBox.appId, ApplicationInfoInterface.MainStage) === ApplicationInfoInterface.SideStage
614 }, true);
614 }, true);
615− var webbrowserSurfaceId = topSurfaceList.nextId;
615+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
616 webbrowserCheckBox.checked = true;
616 webbrowserCheckBox.checked = true;
617 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
617 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
618
618
@@ -628,7 +628,7 @@ Rectangle {
628
628
629 /*
629 /*
630 1- Suspended app gets killed behind the scenes, causing its surface to go zombie.
630 1- Suspended app gets killed behind the scenes, causing its surface to go zombie.
631− 2- Surface gets screenshotted and removed. Its slot in the topSurfaceList remains,
631+ 2- Surface gets screenshotted and removed. Its slot in the topLevelSurfaceList remains,
632 though (so ApplicationWindow can display the screenshot in its place).
632 though (so ApplicationWindow can display the screenshot in its place).
633 3- User taps on the screenshot of the long-gone surface.
633 3- User taps on the screenshot of the long-gone surface.
634
634
@@ -636,11 +636,11 @@ Rectangle {
636 Application gets relaunched. Its new surface will seamlessly replace the screenshot.
636 Application gets relaunched. Its new surface will seamlessly replace the screenshot.
637 */
637 */
638 function test_selectSuspendedAppWithoutSurface() {
638 function test_selectSuspendedAppWithoutSurface() {
639− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
639+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
640− var dashSurfaceId = topSurfaceList.idAt(0);
640+ var dashSurfaceId = topLevelSurfaceList.idAt(0);
641− var dashWindow = topSurfaceList.windowAt(0);
641+ var dashWindow = topLevelSurfaceList.windowAt(0);
642
642
643− var webbrowserSurfaceId = topSurfaceList.nextId;
643+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
644 webbrowserCheckBox.checked = true;
644 webbrowserCheckBox.checked = true;
645 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
645 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
646 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
646 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
@@ -657,22 +657,22 @@ Rectangle {
657
657
658 // wait until the surface is gone
658 // wait until the surface is gone
659 tryCompare(webbrowserApp.surfaceList, "count", 0);
659 tryCompare(webbrowserApp.surfaceList, "count", 0);
660− compare(topSurfaceList.surfaceAt(topSurfaceList.indexForId(webbrowserSurfaceId)), null);
660+ compare(topLevelSurfaceList.surfaceAt(topLevelSurfaceList.indexForId(webbrowserSurfaceId)), null);
661
661
662 switchToSurface(webbrowserSurfaceId);
662 switchToSurface(webbrowserSurfaceId);
663
663
664 // webbrowser should have been brought to front
664 // webbrowser should have been brought to front
665− tryCompareFunction(function(){return topSurfaceList.idAt(0);}, webbrowserSurfaceId);
665+ tryCompareFunction(function(){return topLevelSurfaceList.idAt(0);}, webbrowserSurfaceId);
666
666
667 // and it should eventually get a new surface and get resumed
667 // and it should eventually get a new surface and get resumed
668− tryCompareFunction(function(){return topSurfaceList.surfaceAt(0) !== null;}, true);
668+ tryCompareFunction(function(){return topLevelSurfaceList.surfaceAt(0) !== null;}, true);
669− compare(topSurfaceList.count, 2); // still two top-level items
669+ compare(topLevelSurfaceList.count, 2); // still two top-level items
670 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
670 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
671 compare(webbrowserApp.surfaceList.count, 1);
671 compare(webbrowserApp.surfaceList.count, 1);
672 }
672 }
673
673
674 function test_draggingSurfaceKeepsSurfaceFocus() {
674 function test_draggingSurfaceKeepsSurfaceFocus() {
675− var webbrowserSurfaceId = topSurfaceList.nextId;
675+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
676 webbrowserCheckBox.checked = true;
676 webbrowserCheckBox.checked = true;
677 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
677 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
678
678
@@ -690,8 +690,8 @@ Rectangle {
690
690
691 function test_dashDoesNotDragToSidestage() {
691 function test_dashDoesNotDragToSidestage() {
692 sideStage.showNow();
692 sideStage.showNow();
693− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
693+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
694− var dashSurfaceId = topSurfaceList.idAt(0);
694+ var dashSurfaceId = topLevelSurfaceList.idAt(0);
695
695
696 var appDelegate = findChild(stage, "appDelegate_" + dashSurfaceId);
696 var appDelegate = findChild(stage, "appDelegate_" + dashSurfaceId);
697 verify(appDelegate);
697 verify(appDelegate);
@@ -713,7 +713,7 @@ Rectangle {
713
713
714 function test_switchRestoreStageOnRotation() {
714 function test_switchRestoreStageOnRotation() {
715 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
715 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
716− var webbrowserSurfaceId = topSurfaceList.nextId;
716+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
717 webbrowserCheckBox.checked = true;
717 webbrowserCheckBox.checked = true;
718 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
718 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
719
719
@@ -732,7 +732,7 @@ Rectangle {
732 }
732 }
733
733
734 function test_restoreSavedStageOnCloseReopen() {
734 function test_restoreSavedStageOnCloseReopen() {
735− var webbrowserSurfaceId = topSurfaceList.nextId;
735+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
736 webbrowserCheckBox.checked = true;
736 webbrowserCheckBox.checked = true;
737 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
737 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
738
738
@@ -750,7 +750,7 @@ Rectangle {
750 // back to landscape
750 // back to landscape
751 stage.shellOrientation = Qt.LandscapeOrientation;
751 stage.shellOrientation = Qt.LandscapeOrientation;
752
752
753− webbrowserSurfaceId = topSurfaceList.nextId;
753+ webbrowserSurfaceId = topLevelSurfaceList.nextId;
754 webbrowserCheckBox.checked = true;
754 webbrowserCheckBox.checked = true;
755 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
755 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
756
756