on xenial help sign in
Remove stage property from Application
ded105dDaniel d'Andrada
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=19)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=20)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
debian/control+3−3
@@ -35,7 +35,7 @@ Build-Depends: cmake,
35 libubuntugestures5-dev (>= 1.3.2030),
35 libubuntugestures5-dev (>= 1.3.2030),
36 libubuntugestures5-private-dev (>= 1.3.2030),
36 libubuntugestures5-private-dev (>= 1.3.2030),
37 libudev-dev,
37 libudev-dev,
38− libunity-api-dev (>= 7.116),
38+ libunity-api-dev (>= 7.117),
39 libusermetricsoutput1-dev,
39 libusermetricsoutput1-dev,
40# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
40# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
41 libx11-dev[!arm64 !armhf],
41 libx11-dev[!arm64 !armhf],
@@ -153,7 +153,7 @@ Depends: qml-module-qtquick-layouts,
153 qtdeclarative5-ubuntu-settings-components (>= 0.7),
153 qtdeclarative5-ubuntu-settings-components (>= 0.7),
154 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
154 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
155 ubuntu-thumbnailer-impl-0,
155 ubuntu-thumbnailer-impl-0,
156− unity-application-impl-19,
156+ unity-application-impl-20,
157 unity-notifications-impl-3,
157 unity-notifications-impl-3,
158 unity-plugin-scopes | unity-scopes-impl,
158 unity-plugin-scopes | unity-scopes-impl,
159 unity-scopes-impl-12,
159 unity-scopes-impl-12,
@@ -199,7 +199,7 @@ Pre-Depends: ${misc:Pre-Depends},
199Depends: ${misc:Depends},
199Depends: ${misc:Depends},
200 ${shlibs:Depends},
200 ${shlibs:Depends},
201Provides: unity-application-impl,
201Provides: unity-application-impl,
202− unity-application-impl-19,
202+ unity-application-impl-20,
203Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
203Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
204Description: Fake environment for running Unity 8 shell
204Description: Fake environment for running Unity 8 shell
205 Provides fake implementations of some QML modules used by Unity 8 shell
205 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/TabletStage.qml+1−1
@@ -542,7 +542,7 @@ AbstractStage {
542 if (!app) {
542 if (!app) {
543 return index;
543 return index;
544 }
544 }
545− var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : app.stage;
545+ var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : ApplicationInfoInterface.MainStage;
546
546
547 // don't shuffle indexes greater than "actives or next"
547 // don't shuffle indexes greater than "actives or next"
548 if (index > 2) return index;
548 if (index > 2) return index;
tests/mocks/Unity/Application/ApplicationInfo.cpp−8
@@ -175,14 +175,6 @@ void ApplicationInfo::setIcon(const QUrl &value)
175 }
175 }
176}
176}
177
177
178−void ApplicationInfo::setStage(Stage value)
179−{
180− if (value != m_stage) {
181− m_stage = value;
182− Q_EMIT stageChanged(value);
183− }
184−}
185−
186void ApplicationInfo::setState(State value)
178void ApplicationInfo::setState(State value)
187{
179{
188 if (value != m_state) {
180 if (value != m_state) {
tests/mocks/Unity/Application/ApplicationInfo.h−4
@@ -67,9 +67,6 @@ public:
67
67
68 QUrl icon() const override { return m_icon; }
68 QUrl icon() const override { return m_icon; }
69
69
70− Q_INVOKABLE void setStage(Stage value) override; // invokable only for mock
71− Stage stage() const override { return m_stage; }
72−
73 Q_INVOKABLE void setState(State value);
70 Q_INVOKABLE void setState(State value);
74 State state() const override { return m_state; }
71 State state() const override { return m_state; }
75
72
@@ -137,7 +134,6 @@ private:
137 QString m_appId;
134 QString m_appId;
138 QString m_name;
135 QString m_name;
139 QUrl m_icon;
136 QUrl m_icon;
140− Stage m_stage{MainStage};
141 State m_state{Stopped};
137 State m_state{Stopped};
142 bool m_fullscreen{false};
138 bool m_fullscreen{false};
143 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
139 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
tests/mocks/Unity/Application/ApplicationManager.cpp−10
@@ -102,8 +102,6 @@ QVariant ApplicationManager::data(const QModelIndex& index, int role) const {
102 return app->comment();
102 return app->comment();
103 case RoleIcon:
103 case RoleIcon:
104 return app->icon();
104 return app->icon();
105− case RoleStage:
106− return app->stage();
107 case RoleState:
105 case RoleState:
108 return app->state();
106 return app->state();
109 case RoleFocused:
107 case RoleFocused:
@@ -166,11 +164,6 @@ bool ApplicationManager::add(ApplicationInfo *application) {
166 if (!appIndex.isValid()) return;
164 if (!appIndex.isValid()) return;
167 Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
165 Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
168 });
166 });
169− connect(application, &ApplicationInfo::stageChanged, this, [application, this]() {
170− QModelIndex appIndex = findIndex(application);
171− if (!appIndex.isValid()) return;
172− Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleStage);
173− });
174
167
175 connect(application, &ApplicationInfo::closed, this, [application, this]() {
168 connect(application, &ApplicationInfo::closed, this, [application, this]() {
176 this->remove(application);
169 this->remove(application);
@@ -344,7 +337,6 @@ void ApplicationManager::buildListOfAvailableApplications()
344 application->setScreenshotId("gallery");
337 application->setScreenshotId("gallery");
345 application->setIconId("gallery");
338 application->setIconId("gallery");
346 application->setShellChrome(Mir::LowChrome);
339 application->setShellChrome(Mir::LowChrome);
347− application->setStage(ApplicationInfo::MainStage);
348 m_availableApplications.append(application);
340 m_availableApplications.append(application);
349
341
350 application = new ApplicationInfo(this);
342 application = new ApplicationInfo(this);
@@ -381,7 +373,6 @@ void ApplicationManager::buildListOfAvailableApplications()
381 application->setName("GMail");
373 application->setName("GMail");
382 application->setIconId("gmail");
374 application->setIconId("gmail");
383 application->setScreenshotId("gmail-webapp.svg");
375 application->setScreenshotId("gmail-webapp.svg");
384− application->setStage(ApplicationInfo::MainStage);
385 application->setSupportedOrientations(Qt::PortraitOrientation
376 application->setSupportedOrientations(Qt::PortraitOrientation
386 | Qt::LandscapeOrientation
377 | Qt::LandscapeOrientation
387 | Qt::InvertedPortraitOrientation
378 | Qt::InvertedPortraitOrientation
@@ -393,7 +384,6 @@ void ApplicationManager::buildListOfAvailableApplications()
393 application->setName("Music");
384 application->setName("Music");
394 application->setIconId("soundcloud");
385 application->setIconId("soundcloud");
395 application->setScreenshotId("music");
386 application->setScreenshotId("music");
396− application->setStage(ApplicationInfo::MainStage);
397 application->setSupportedOrientations(Qt::PortraitOrientation
387 application->setSupportedOrientations(Qt::PortraitOrientation
398 | Qt::LandscapeOrientation
388 | Qt::LandscapeOrientation
399 | Qt::InvertedPortraitOrientation
389 | Qt::InvertedPortraitOrientation
tests/plugins/Unity/Launcher/launchermodeltest.cpp−2
@@ -49,8 +49,6 @@ public:
49 QString name() const override { return "mock"; }
49 QString name() const override { return "mock"; }
50 QString comment() const override { return "this is a mock"; }
50 QString comment() const override { return "this is a mock"; }
51 QUrl icon() const override { return QUrl(); }
51 QUrl icon() const override { return QUrl(); }
52− ApplicationInfoInterface::Stage stage() const override { return ApplicationInfoInterface::MainStage; }
53− void setStage(ApplicationInfoInterface::Stage) override {}
54 ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
52 ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
55 bool focused() const override { return m_focused; }
53 bool focused() const override { return m_focused; }
56 QString splashTitle() const override { return QString(); }
54 QString splashTitle() const override { return QString(); }
tests/qmltests/Stages/tst_TabletStage.qml+6−3
@@ -290,8 +290,9 @@ Rectangle {
290 var webbrowserSurfaceId = topSurfaceList.nextId;
290 var webbrowserSurfaceId = topSurfaceList.nextId;
291 webbrowserCheckBox.checked = true;
291 webbrowserCheckBox.checked = true;
292 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
292 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
293− var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
293+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
294+ verify(webbrowserDelegate);
294− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
295+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
295 var webbrowserWindow = findAppWindowForSurfaceId(webbrowserSurfaceId);
296 var webbrowserWindow = findAppWindowForSurfaceId(webbrowserSurfaceId);
296 verify(webbrowserWindow);
297 verify(webbrowserWindow);
297
298
@@ -397,8 +398,10 @@ Rectangle {
397 var webbrowserSurfaceId = topSurfaceList.nextId;
398 var webbrowserSurfaceId = topSurfaceList.nextId;
398 webbrowserCheckBox.checked = true;
399 webbrowserCheckBox.checked = true;
399 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
400 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
401+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
402+ verify(webbrowserDelegate);
403+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
400 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
404 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
401− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
402
405
403 var gallerySurfaceId = topSurfaceList.nextId;
406 var gallerySurfaceId = topSurfaceList.nextId;
404 galleryCheckBox.checked = true;
407 galleryCheckBox.checked = true;
tests/qmltests/tst_OrientedShell.qml+10−6
@@ -515,7 +515,6 @@ Rectangle {
515 compare(primaryDelegate.focus, true);
515 compare(primaryDelegate.focus, true);
516 compare(primaryApp.rotatesWindowContents, false);
516 compare(primaryApp.rotatesWindowContents, false);
517 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
517 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
518− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
519
518
520 tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
519 tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
521 verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
520 verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
@@ -559,7 +558,8 @@ Rectangle {
559 compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
558 compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
560 compare(primaryApp.rotatesWindowContents, false);
559 compare(primaryApp.rotatesWindowContents, false);
561 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
560 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
561+ var primaryDelegate = findChild(shell, "spreadDelegate_" + primarySurfaceId);
562− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
562+ compare(primaryDelegate.stage, ApplicationInfoInterface.MainStage);
563
563
564 tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
564 tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
565
565
@@ -599,7 +599,6 @@ Rectangle {
599 compare(gmailApp.rotatesWindowContents, false);
599 compare(gmailApp.rotatesWindowContents, false);
600 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
600 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
601 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
601 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
602− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
603
602
604 // wait until it's able to rotate
603 // wait until it's able to rotate
605 tryCompare(shell, "orientationChangesEnabled", true);
604 tryCompare(shell, "orientationChangesEnabled", true);
@@ -724,7 +723,6 @@ Rectangle {
724 compare(gmailApp.rotatesWindowContents, false);
723 compare(gmailApp.rotatesWindowContents, false);
725 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
724 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
726 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
725 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
727− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
728
726
729 waitUntilAppWindowIsFullyLoaded(gmailSurfaceId);
727 waitUntilAppWindowIsFullyLoaded(gmailSurfaceId);
730
728
@@ -736,7 +734,10 @@ Rectangle {
736 compare(musicApp.rotatesWindowContents, false);
734 compare(musicApp.rotatesWindowContents, false);
737 compare(musicApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
735 compare(musicApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
738 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
736 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
737+ if (data.deviceName === "manta" || data.deviceName === "flo") {
738+ var musicDelegate = findChild(shell, "spreadDelegate_" + musicSurfaceId);
739− compare(musicApp.stage, ApplicationInfoInterface.MainStage);
739+ compare(musicDelegate.stage, ApplicationInfoInterface.MainStage);
740+ }
740
741
741 waitUntilAppWindowIsFullyLoaded(musicSurfaceId);
742 waitUntilAppWindowIsFullyLoaded(musicSurfaceId);
742 tryCompare(shell, "orientationChangesEnabled", true);
743 tryCompare(shell, "orientationChangesEnabled", true);
@@ -889,6 +890,7 @@ Rectangle {
889 ];
890 ];
890 }
891 }
891 function test_appInSideStageDoesntRotateOnStartUp(data) {
892 function test_appInSideStageDoesntRotateOnStartUp(data) {
893+ WindowStateStorage.saveStage("twitter-webapp", ApplicationInfoInterface.SideStage)
892 loadShell(data.deviceName);
894 loadShell(data.deviceName);
893
895
894 var twitterDelegate = null;
896 var twitterDelegate = null;
@@ -905,9 +907,11 @@ Rectangle {
905 signalSpy.target = null;
907 signalSpy.target = null;
906 signalSpy.signalName = "runningChanged";
908 signalSpy.signalName = "runningChanged";
907
909
910+ var twitterSurfaceId = topLevelSurfaceList.nextId;
908 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
911 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
909 verify(twitterApp);
912 verify(twitterApp);
913+ var twitterDelegate = findChild(shell, "spreadDelegate_" + twitterSurfaceId);
910− twitterApp.stage = ApplicationInfoInterface.SideStage;
914+ compare(twitterDelegate.stage, ApplicationInfoInterface.SideStage);
911
915
912 // ensure the mock twitter-webapp is as we expect
916 // ensure the mock twitter-webapp is as we expect
913 compare(twitterApp.rotatesWindowContents, false);
917 compare(twitterApp.rotatesWindowContents, false);
tests/qmltests/tst_Shell.qml+14−4
@@ -2103,8 +2103,13 @@ Rectangle {
2103 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
2103 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
2104
2104
2105 // Sanity checking
2105 // Sanity checking
2106+ if (data.usageScenario === "tablet") {
2107+ var app1Delegate = findChild(shell, "spreadDelegate_" + app1SurfaceId);
2106− compare(app1.stage, ApplicationInfoInterface.MainStage);
2108+ compare(app1Delegate.stage, ApplicationInfoInterface.MainStage);
2109+
2110+ var app2Delegate = findChild(shell, "spreadDelegate_" + app2SurfaceId);
2107− compare(app2.stage, ApplicationInfoInterface.MainStage);
2111+ compare(app2Delegate.stage, ApplicationInfoInterface.MainStage);
2112+ }
2108 verify(!app1.isTouchApp);
2113 verify(!app1.isTouchApp);
2109
2114
2110 var app1Surface = app1.surfaceList.get(0);
2115 var app1Surface = app1.surfaceList.get(0);
@@ -2139,8 +2144,13 @@ Rectangle {
2139 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
2144 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
2140
2145
2141 // Sanity checking
2146 // Sanity checking
2147+ if (data.usageScenario === "tablet") {
2148+ var app1Delegate = findChild(shell, "spreadDelegate_" + app1SurfaceId);
2142− compare(app1.stage, ApplicationInfoInterface.MainStage);
2149+ compare(app1Delegate.stage, ApplicationInfoInterface.MainStage);
2150+
2151+ var app2Delegate = findChild(shell, "spreadDelegate_" + app2SurfaceId);
2143− compare(app2.stage, ApplicationInfoInterface.MainStage);
2152+ compare(app2Delegate.stage, ApplicationInfoInterface.MainStage);
2153+ }
2144
2154
2145 var app1Surface = app1.surfaceList.get(0);
2155 var app1Surface = app1.surfaceList.get(0);
2146 verify(app1Surface);
2156 verify(app1Surface);