on xenial help sign in
only change app's status to running after some timeout
commit25084e6492184127f1237463a3ac1b546c57729d authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 20 Mar 2014, 11:02 (13 years ago) parentf7114ad
3 files changed+12−3
qml/Stages/PhoneStage.qml+1−1 tests/mocks/Unity/Application/ApplicationInfo.cpp+10−2 tests/mocks/Unity/Application/ApplicationInfo.h+1
qml/Stages/PhoneStage.qml+1−1
@@ -170,7 +170,7 @@ Item {
170170 // Mir signals us that the newly started app has gotten focus before it paints something on the screen
171171 // This would result in the old app surface becoming visible for a bit.
172172 // FIXME: change appManager to only change the focusedApplicationId when the surface is ready to be shown.
173− interval: 0// 1500
173+ interval: 1500
174174 repeat: false
175175 onTriggered: {
176176 priv.applicationStarting = false;
tests/mocks/Unity/Application/ApplicationInfo.cpp+10−2
@@ -26,25 +26,27 @@ ApplicationInfo::ApplicationInfo(const QString &appId, QObject *parent)
2626 : ApplicationInfoInterface(appId, parent)
2727 ,m_appId(appId)
2828 ,m_stage(MainStage)
29− ,m_state(Running)
29+ ,m_state(Starting)
3030 ,m_focused(false)
3131 ,m_fullscreen(false)
3232 ,m_windowItem(0)
3333 ,m_windowComponent(0)
3434 ,m_parentItem(0)
3535{
36+ QTimer::singleShot(300, this, SLOT(setRunning()));
3637}
3738
3839ApplicationInfo::ApplicationInfo(QObject *parent)
3940 : ApplicationInfoInterface(QString(), parent)
4041 ,m_stage(MainStage)
41− ,m_state(Running)
42+ ,m_state(Starting)
4243 ,m_focused(false)
4344 ,m_fullscreen(false)
4445 ,m_windowItem(0)
4546 ,m_windowComponent(0)
4647 ,m_parentItem(0)
4748{
49+ QTimer::singleShot(300, this, SLOT(setRunning()));
4850}
4951
5052void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status status)
@@ -53,6 +55,12 @@ void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status statu
5355 doCreateWindowItem();
5456}
5557
58+void ApplicationInfo::setRunning()
59+{
60+ m_state = Running;
61+ Q_EMIT stateChanged();
62+}
63+
5664void ApplicationInfo::createWindowComponent()
5765{
5866 // The assumptions I make here really should hold.
tests/mocks/Unity/Application/ApplicationInfo.h+1
@@ -84,6 +84,7 @@ class ApplicationInfo : public ApplicationInfoInterface {
8484
8585 private Q_SLOTS:
8686 void onWindowComponentStatusChanged(QQmlComponent::Status status);
87+ void setRunning();
8788
8889 private:
8990 void createWindowItem();