on xenial help sign in
hide stages if current app is unfocused (e.g. closed)
commit7f753487002d123dfd40bcb72f71e2fd363fd4ab authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 5 Feb 2014, 17:21 (13 years ago) parent8167701
3 files changed+13−2
qml/Shell.qml+5−1 tests/mocks/Unity/Application/ApplicationManager.cpp+3−1 tests/qmltests/tst_Shell.qml+5
qml/Shell.qml+5−1
@@ -234,7 +234,9 @@ FocusScope {
234234
235235 function hide() {
236236 shown = false;
237− ApplicationManager.unfocusCurrentApplication();
237+ if (ApplicationManager.focusedApplicationId) {
238+ ApplicationManager.unfocusCurrentApplication();
239+ }
238240 }
239241
240242 Connections {
@@ -242,6 +244,8 @@ FocusScope {
242244 onFocusedApplicationIdChanged: {
243245 if (ApplicationManager.focusedApplicationId.length > 0) {
244246 stages.show();
247+ } else {
248+ stages.hide();
245249 }
246250 }
247251
tests/mocks/Unity/Application/ApplicationManager.cpp+3−1
@@ -191,8 +191,10 @@ bool ApplicationManager::stopApplication(const QString &appId)
191191 if (application == nullptr)
192192 return false;
193193
194+ if (application->appId() == focusedApplicationId()) {
195+ unfocusCurrentApplication();
196+ }
194197 remove(application);
195− Q_EMIT focusedApplicationIdChanged();
196198 qDebug() << Q_FUNC_INFO << "emitting focusedAppChanged" << focusedApplicationId();
197199 return true;
198200}
tests/qmltests/tst_Shell.qml+5
@@ -103,8 +103,12 @@ Item {
103103 swipeAwayGreeter();
104104 }
105105
106+ print("killing apps in 5 secs")
107+ wait(1000)
106108 // kill all (fake) running apps
107109 killApps(ApplicationManager);
110+ print("killed apps")
111+ wait(1000)
108112
109113 var dashHome = findChild(shell, "DashHome");
110114 swipeUntilScopeViewIsReached(dashHome);
@@ -511,6 +515,7 @@ Item {
511515 function test_DashShown(data) {
512516
513517 print("step1")
518+// wait(1000)
514519 // greeter: false,
515520 if (data.greeter) {
516521 // Swipe the greeter in