on xenial help sign in
merged with pre-req
commitc403943273db3d750a38f1e5407e926c2ee1f6bd authorNick Dedekind <nick.dedekind@canonical.com> dateMon 27 Mar 2017, 14:58 (10 years ago) parentc9164f6d55f783
8 files changed+91−87
plugins/WindowManager/Screen.cpp+8−7 plugins/WindowManager/Screen.h+5−5 plugins/WindowManager/Screens.cpp+12−11 plugins/WindowManager/Screens.h+5−4 plugins/WindowManager/WorkspaceModel.cpp+11−9 plugins/WindowManager/WorkspaceModel.h+5−5 tests/qmltests/Stage/tst_PhoneStage.qml+4−5 tests/qmltests/Stage/tst_TabletStage.qml+41−41
plugins/WindowManager/Screen.cpp+8−7
@@ -185,11 +185,6 @@ QString Screen::outputTypeName() const
185185 return QString();
186186}
187187
188−void Screen::setSyncing(bool syncing)
189−{
190− workspaces()->setSyncing(syncing);
191−}
192−
193188void Screen::sync(Screen *proxy)
194189{
195190 if (!proxy) return;
@@ -258,9 +253,10 @@ void ConcreteScreen::setCurrentWorkspace(Workspace *workspace)
258253 }
259254}
260255
261−ProxyScreen::ProxyScreen(Screen *const screen)
262− : m_workspaces(new ProxyWorkspaceModel(screen->workspaces()))
256+ProxyScreen::ProxyScreen(Screen *const screen, ProxyScreens* screens)
257+ : m_workspaces(new ProxyWorkspaceModel(screen->workspaces(), this))
263258 , m_original(screen)
259+ , m_screens(screens)
264260{
265261 connectToScreen(screen);
266262
@@ -296,3 +292,8 @@ void ProxyScreen::setCurrentWorkspace(Workspace *workspace)
296292 m_original->setCurrentWorkspace(p->proxyObject());
297293 }
298294}
295+
296+bool ProxyScreen::isSyncing() const
297+{
298+ return m_screens->isSyncing();
299+}
plugins/WindowManager/Screen.h+5−5
@@ -8,7 +8,7 @@
88#include "WorkspaceModel.h"
99
1010class ProxyScreen;
11−class ScreenAttached;
11+class ProxyScreens;
1212
1313class Screen: public QObject
1414{
@@ -55,7 +55,6 @@ public:
5555 virtual Workspace *currentWorkspace() const = 0;
5656 virtual void setCurrentWorkspace(Workspace* workspace) = 0;
5757
58− void setSyncing(bool);
5958 void sync(Screen* proxy);
6059
6160 qtmir::Screen* wrapped() const { return m_wrapped; }
@@ -101,8 +100,6 @@ public:
101100 Workspace *currentWorkspace() const override;
102101 void setCurrentWorkspace(Workspace* workspace) override;
103102
104− static ScreenAttached *qmlAttachedProperties(QObject *owner);
105−
106103protected:
107104 void resetCurrentWorkspace();
108105
@@ -114,7 +111,7 @@ class ProxyScreen : public Screen
114111{
115112 Q_OBJECT
116113public:
117− explicit ProxyScreen(Screen*const screen);
114+ explicit ProxyScreen(Screen*const screen, ProxyScreens* screens);
118115
119116 // From qtmir::Screen
120117 WorkspaceModel* workspaces() const override;
@@ -123,9 +120,12 @@ public:
123120
124121 Screen* proxyObject() const { return m_original.data(); }
125122
123+ bool isSyncing() const;
124+
126125private:
127126 const QScopedPointer<WorkspaceModel> m_workspaces;
128127 const QPointer<Screen> m_original;
128+ const ProxyScreens* m_screens;
129129 QPointer<Workspace> m_currentWorspace;
130130};
131131
plugins/WindowManager/Screens.cpp+12−11
@@ -137,22 +137,17 @@ ProxyScreens *ConcreteScreens::createProxy()
137137 return new ProxyScreens(this);
138138}
139139
140−void ConcreteScreens::sync(Screens *proxy)
140+void ConcreteScreens::sync(ProxyScreens *proxy)
141141{
142142 if (!proxy) return;
143−
144− for (auto screen : m_screens) {
145− screen->setSyncing(true);
146− }
143+ proxy->setSyncing(true);
147144
148145 const auto& proxyList = proxy->list();
149146 for (int i = 0; i < m_screens.count() && i < proxyList.count(); ++i) {
150147 m_screens[i]->sync(proxyList[i]);
151148 }
152149
153− for (auto screen : m_screens) {
154− screen->setSyncing(false);
155− }
150+ proxy->setSyncing(true);
156151}
157152
158153void ConcreteScreens::onScreenAdded(qtmir::Screen *added)
@@ -199,6 +194,7 @@ void ConcreteScreens::onScreenRemoved(qtmir::Screen *removed)
199194ProxyScreens::ProxyScreens(Screens * const screens)
200195 : Screens(screens->m_wrapped)
201196 , m_original(screens)
197+ , m_syncing(false)
202198{
203199 connect(screens, &Screens::screenAdded, this, [this](Screen *added) {
204200 Q_FOREACH(auto screen, m_screens) {
@@ -207,7 +203,7 @@ ProxyScreens::ProxyScreens(Screens * const screens)
207203 }
208204
209205 beginInsertRows(QModelIndex(), count(), count());
210− auto screenWrapper(new ProxyScreen(added));
206+ auto screenWrapper(new ProxyScreen(added, this));
211207 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
212208 m_screens.push_back(screenWrapper);
213209 endInsertRows();
@@ -237,8 +233,13 @@ ProxyScreens::ProxyScreens(Screens * const screens)
237233 });
238234
239235 Q_FOREACH(Screen* screen, screens->list()) {
240− auto screenWrapper(new ProxyScreen(screen));
236+ auto screenWrapper(new ProxyScreen(screen, this));
241237 QQmlEngine::setObjectOwnership(screenWrapper, QQmlEngine::CppOwnership);
242− m_screens.push_back(new ProxyScreen(screen));
238+ m_screens.push_back(screenWrapper);
243239 }
244240}
241+
242+void ProxyScreens::setSyncing(bool syncing)
243+{
244+ m_syncing = syncing;
245+}
plugins/WindowManager/Screens.h+5−4
@@ -55,8 +55,6 @@ public:
5555 int count() const;
5656 QVariant activeScreen() const;
5757
58− bool isSyncing() const { return m_syncing; }
59−
6058 const QVector<Screen*>& list() const { return m_screens; }
6159
6260public Q_SLOTS:
@@ -74,7 +72,6 @@ protected:
7472
7573 QVector<Screen*> m_screens;
7674 const QSharedPointer<qtmir::Screens> m_wrapped;
77− bool m_syncing;
7875
7976 friend class ProxyScreens;
8077};
@@ -87,7 +84,7 @@ public:
8784 ~ConcreteScreens();
8885
8986 Q_INVOKABLE ProxyScreens *createProxy();
90− Q_INVOKABLE void sync(Screens *proxy);
87+ Q_INVOKABLE void sync(ProxyScreens *proxy);
9188
9289 static ConcreteScreens *self();
9390
@@ -106,8 +103,12 @@ class ProxyScreens : public Screens
106103public:
107104 explicit ProxyScreens(Screens*const screens);
108105
106+ void setSyncing(bool syncing);
107+ bool isSyncing() const { return m_syncing; }
108+
109109private:
110110 const QPointer<Screens> m_original;
111+ bool m_syncing;
111112};
112113
113114#endif // SCREENS_H
plugins/WindowManager/WorkspaceModel.cpp+11−9
@@ -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();
plugins/WindowManager/WorkspaceModel.h+5−5
@@ -25,6 +25,7 @@ Q_DECLARE_LOGGING_CATEGORY(WORKSPACES)
2525
2626class Workspace;
2727class ProxyWorkspaceModel;
28+class ProxyScreen;
2829
2930class WorkspaceModel : public QAbstractListModel
3031{
@@ -61,12 +62,9 @@ public:
6162
6263 const QVector<Workspace*>& list() const { return m_workspaces; }
6364
64− void setSyncing(bool);
6565 void sync(WorkspaceModel* proxy);
6666 void finishSync();
6767
68− bool isSyncing() { return m_syncing; }
69−
7068Q_SIGNALS:
7169 void countChanged();
7270
@@ -79,7 +77,6 @@ protected:
7977
8078 QVector<Workspace*> m_workspaces;
8179 QSet<Workspace*> m_unassignedWorkspaces;
82− bool m_syncing;
8380
8481 friend class ProxyWorkspaceModel;
8582};
@@ -88,15 +85,18 @@ class ProxyWorkspaceModel : public WorkspaceModel
8885{
8986 Q_OBJECT
9087public:
91− explicit ProxyWorkspaceModel(WorkspaceModel*const model);
88+ explicit ProxyWorkspaceModel(WorkspaceModel*const model, ProxyScreen* screen);
9289
9390 Q_INVOKABLE void move(int from, int to) override;
9491
92+ bool isSyncing() const;
93+
9594public Q_SLOTS:
9695 void addWorkspace();
9796
9897protected:
9998 const QPointer<WorkspaceModel> m_original;
99+ const ProxyScreen* m_screen;
100100};
101101
102102#endif // WORKSPACEMODEL_H
tests/qmltests/Stage/tst_PhoneStage.qml+4−5
@@ -31,6 +31,8 @@ Item {
3131
3232 property var greeter: { fullyShown: true }
3333
34+ readonly property var topLevelSurfaceList: WorkspaceManager.activeWorkspace.windowModel
35+
3436 ApplicationMenuDataLoader {
3537 id: appMenuData
3638 }
@@ -45,11 +47,8 @@ Item {
4547 orientations: Orientations {}
4648 applicationManager: ApplicationManager
4749 mode: "staged"
48− topLevelSurfaceList: TopLevelWindowModel {
49− id: topLevelSurfaceList
50− applicationManager: ApplicationManager
51− surfaceManager: SurfaceManager
52− }
50+ topLevelSurfaceList: root.topLevelSurfaceList
51+
5352 Component.onCompleted: {
5453 ApplicationManager.startApplication("unity8-dash");
5554 }
tests/qmltests/Stage/tst_TabletStage.qml+41−41
@@ -35,6 +35,8 @@ Rectangle {
3535
3636 property var greeter: { fullyShown: true }
3737
38+ readonly property var topLevelSurfaceList: WorkspaceManager.activeWorkspace.windowModel
39+
3840 ApplicationMenuDataLoader {
3941 id: appMenuData
4042 }
@@ -54,12 +56,10 @@ Rectangle {
5456 focus: true
5557 mode: "stagedWithSideStage"
5658 applicationManager: ApplicationManager
57− topLevelSurfaceList: TopLevelWindowModel {
58− id: topLevelSurfaceList
59− applicationManager: ApplicationManager
60− surfaceManager: SurfaceManager
61− }
59+ topLevelSurfaceList: root.topLevelSurfaceList
60+
6261 Component.onCompleted: {
62+ print("starting dash")
6363 ApplicationManager.startApplication("unity8-dash");
6464 }
6565 }
@@ -131,21 +131,21 @@ Rectangle {
131131 name: "TabletStage"
132132 when: windowShown
133133
134− readonly property alias topSurfaceList: stage.topLevelSurfaceList
134+ readonly property alias topLevelSurfaceList: root.topLevelSurfaceList
135135 property Item sideStage: stage ? findChild(stage, "sideStage") : null
136136
137137 function init() {
138138 stageSaver.clear();
139139
140140 ApplicationManager.startApplication("unity8-dash");
141− tryCompare(topSurfaceList, "count", 1);
142− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
141+ tryCompare(topLevelSurfaceList, "count", 1);
142+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
143143
144144 // this is very strange, but sometimes the test starts without
145145 // Stage components having finished loading themselves
146146 var appWindow = null
147147 while (!appWindow) {
148− appWindow = findAppWindowForSurfaceId(topSurfaceList.idAt(0));
148+ appWindow = findAppWindowForSurfaceId(topLevelSurfaceList.idAt(0));
149149 if (!appWindow) {
150150 console.log("didn't find unity8-dash appWindow in Stage. Trying again...");
151151 wait(50);
@@ -157,7 +157,7 @@ Rectangle {
157157 tryCompare(appRepeater, "count", 1);
158158 tryCompare(appRepeater.itemAt(0), "x", 0);
159159
160− waitUntilAppSurfaceShowsUp(topSurfaceList.idAt(0));
160+ waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0));
161161 sideStage.hideNow()
162162 tryCompare(sideStage, "x", stage.width)
163163 }
@@ -272,7 +272,7 @@ Rectangle {
272272 function test_tappingSwitchesFocusBetweenStages() {
273273 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
274274
275− var webbrowserSurfaceId = topSurfaceList.nextId;
275+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
276276 webbrowserCheckBox.checked = true;
277277 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
278278 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
@@ -283,7 +283,7 @@ Rectangle {
283283
284284 tryCompare(webbrowserWindow.surface, "activeFocus", true);
285285
286− var dialerSurfaceId = topSurfaceList.nextId;
286+ var dialerSurfaceId = topLevelSurfaceList.nextId;
287287 dialerCheckBox.checked = true;
288288 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
289289
@@ -315,7 +315,7 @@ Rectangle {
315315 function test_closeAppInSideStage() {
316316 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
317317
318− var dialerSurfaceId = topSurfaceList.nextId;
318+ var dialerSurfaceId = topLevelSurfaceList.nextId;
319319 dialerCheckBox.checked = true;
320320 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
321321
@@ -341,7 +341,7 @@ Rectangle {
341341 }
342342
343343 function test_suspendsAndResumesAppsInMainStage() {
344− var webbrowserSurfaceId = topSurfaceList.nextId;
344+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
345345 webbrowserCheckBox.checked = true;
346346 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
347347 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
@@ -350,7 +350,7 @@ Rectangle {
350350
351351 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
352352
353− var gallerySurfaceId = topSurfaceList.nextId;
353+ var gallerySurfaceId = topLevelSurfaceList.nextId;
354354 galleryCheckBox.checked = true;
355355 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
356356 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
@@ -381,7 +381,7 @@ Rectangle {
381381 // launch two main stage apps
382382 // gallery will be on foreground and webbrowser on background
383383
384− var webbrowserSurfaceId = topSurfaceList.nextId;
384+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
385385 webbrowserCheckBox.checked = true;
386386 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
387387 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
@@ -389,7 +389,7 @@ Rectangle {
389389 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
390390 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
391391
392− var gallerySurfaceId = topSurfaceList.nextId;
392+ var gallerySurfaceId = topLevelSurfaceList.nextId;
393393 galleryCheckBox.checked = true;
394394 waitUntilAppSurfaceShowsUp(gallerySurfaceId);
395395 var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId);
@@ -401,14 +401,14 @@ Rectangle {
401401 // then launch two side stage apps
402402 // facebook will be on foreground and dialer on background
403403
404− var dialerSurfaceId = topSurfaceList.nextId;
404+ var dialerSurfaceId = topLevelSurfaceList.nextId;
405405 dialerCheckBox.checked = true;
406406 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
407407 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
408408 var dialerDelegate = findChild(stage, "appDelegate_" + dialerSurfaceId);
409409 compare(dialerDelegate.stage, ApplicationInfoInterface.SideStage);
410410
411− var facebookSurfaceId = topSurfaceList.nextId;
411+ var facebookSurfaceId = topLevelSurfaceList.nextId;
412412 facebookCheckBox.checked = true;
413413 waitUntilAppSurfaceShowsUp(facebookSurfaceId);
414414 var facebookApp = ApplicationManager.findApplication(facebookCheckBox.appId);
@@ -443,14 +443,14 @@ Rectangle {
443443 function test_foregroundAppsAreSuspendedWhenStageIsSuspended() {
444444 WindowStateStorage.saveStage(dialerCheckBox.appId, ApplicationInfoInterface.SideStage)
445445
446− var webbrowserSurfaceId = topSurfaceList.nextId;
446+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
447447 webbrowserCheckBox.checked = true;
448448 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
449449 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
450450 var webbrowserDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
451451 compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
452452
453− var dialerSurfaceId = topSurfaceList.nextId;
453+ var dialerSurfaceId = topLevelSurfaceList.nextId;
454454 dialerCheckBox.checked = true;
455455 waitUntilAppSurfaceShowsUp(dialerSurfaceId);
456456 var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId);
@@ -524,7 +524,7 @@ Rectangle {
524524 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
525525 tryCompare(stagesPriv, "sideStageAppId", "");
526526
527− var appSurfaceId = topSurfaceList.nextId;
527+ var appSurfaceId = topLevelSurfaceList.nextId;
528528 var app = ApplicationManager.startApplication(data.appId);
529529 waitUntilAppSurfaceShowsUp(appSurfaceId);
530530
@@ -548,7 +548,7 @@ Rectangle {
548548 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
549549 tryCompare(stagesPriv, "sideStageAppId", "");
550550
551− var webbrowserSurfaceId = topSurfaceList.nextId;
551+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
552552 webbrowserCheckBox.checked = true;
553553 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
554554
@@ -573,7 +573,7 @@ Rectangle {
573573 tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
574574 tryCompare(stagesPriv, "sideStageAppId", "");
575575
576− var webbrowserSurfaceId = topSurfaceList.nextId;
576+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
577577 webbrowserCheckBox.checked = true;
578578 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
579579
@@ -591,7 +591,7 @@ Rectangle {
591591 function test_loadSideStageByDraggingFromMainStage() {
592592 sideStage.showNow();
593593 print("sidestage now shown. launching browser")
594− var webbrowserSurfaceId = topSurfaceList.nextId;
594+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
595595 webbrowserCheckBox.checked = true;
596596 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
597597
@@ -612,7 +612,7 @@ Rectangle {
612612 tryCompareFunction(function() {
613613 return WindowStateStorage.getStage(webbrowserCheckBox.appId, ApplicationInfoInterface.MainStage) === ApplicationInfoInterface.SideStage
614614 }, true);
615− var webbrowserSurfaceId = topSurfaceList.nextId;
615+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
616616 webbrowserCheckBox.checked = true;
617617 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
618618
@@ -628,7 +628,7 @@ Rectangle {
628628
629629 /*
630630 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,
632632 though (so ApplicationWindow can display the screenshot in its place).
633633 3- User taps on the screenshot of the long-gone surface.
634634
@@ -636,11 +636,11 @@ Rectangle {
636636 Application gets relaunched. Its new surface will seamlessly replace the screenshot.
637637 */
638638 function test_selectSuspendedAppWithoutSurface() {
639− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
640− var dashSurfaceId = topSurfaceList.idAt(0);
641− var dashWindow = topSurfaceList.windowAt(0);
639+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
640+ var dashSurfaceId = topLevelSurfaceList.idAt(0);
641+ var dashWindow = topLevelSurfaceList.windowAt(0);
642642
643− var webbrowserSurfaceId = topSurfaceList.nextId;
643+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
644644 webbrowserCheckBox.checked = true;
645645 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
646646 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
@@ -657,22 +657,22 @@ Rectangle {
657657
658658 // wait until the surface is gone
659659 tryCompare(webbrowserApp.surfaceList, "count", 0);
660− compare(topSurfaceList.surfaceAt(topSurfaceList.indexForId(webbrowserSurfaceId)), null);
660+ compare(topLevelSurfaceList.surfaceAt(topLevelSurfaceList.indexForId(webbrowserSurfaceId)), null);
661661
662662 switchToSurface(webbrowserSurfaceId);
663663
664664 // webbrowser should have been brought to front
665− tryCompareFunction(function(){return topSurfaceList.idAt(0);}, webbrowserSurfaceId);
665+ tryCompareFunction(function(){return topLevelSurfaceList.idAt(0);}, webbrowserSurfaceId);
666666
667667 // and it should eventually get a new surface and get resumed
668− tryCompareFunction(function(){return topSurfaceList.surfaceAt(0) !== null;}, true);
669− compare(topSurfaceList.count, 2); // still two top-level items
668+ tryCompareFunction(function(){return topLevelSurfaceList.surfaceAt(0) !== null;}, true);
669+ compare(topLevelSurfaceList.count, 2); // still two top-level items
670670 tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running);
671671 compare(webbrowserApp.surfaceList.count, 1);
672672 }
673673
674674 function test_draggingSurfaceKeepsSurfaceFocus() {
675− var webbrowserSurfaceId = topSurfaceList.nextId;
675+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
676676 webbrowserCheckBox.checked = true;
677677 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
678678
@@ -690,8 +690,8 @@ Rectangle {
690690
691691 function test_dashDoesNotDragToSidestage() {
692692 sideStage.showNow();
693− compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
694− var dashSurfaceId = topSurfaceList.idAt(0);
693+ compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
694+ var dashSurfaceId = topLevelSurfaceList.idAt(0);
695695
696696 var appDelegate = findChild(stage, "appDelegate_" + dashSurfaceId);
697697 verify(appDelegate);
@@ -713,7 +713,7 @@ Rectangle {
713713
714714 function test_switchRestoreStageOnRotation() {
715715 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
716− var webbrowserSurfaceId = topSurfaceList.nextId;
716+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
717717 webbrowserCheckBox.checked = true;
718718 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
719719
@@ -732,7 +732,7 @@ Rectangle {
732732 }
733733
734734 function test_restoreSavedStageOnCloseReopen() {
735− var webbrowserSurfaceId = topSurfaceList.nextId;
735+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
736736 webbrowserCheckBox.checked = true;
737737 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
738738
@@ -750,7 +750,7 @@ Rectangle {
750750 // back to landscape
751751 stage.shellOrientation = Qt.LandscapeOrientation;
752752
753− webbrowserSurfaceId = topSurfaceList.nextId;
753+ webbrowserSurfaceId = topLevelSurfaceList.nextId;
754754 webbrowserCheckBox.checked = true;
755755 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
756756