on xenial help sign in
only change app's status to running after some timeout
25084e6Michael Zanetti
qml/Stages/PhoneStage.qml+1−1
@@ -170,7 +170,7 @@ Item {
170 // Mir signals us that the newly started app has gotten focus before it paints something on the screen
170 // Mir signals us that the newly started app has gotten focus before it paints something on the screen
171 // This would result in the old app surface becoming visible for a bit.
171 // This would result in the old app surface becoming visible for a bit.
172 // FIXME: change appManager to only change the focusedApplicationId when the surface is ready to be shown.
172 // FIXME: change appManager to only change the focusedApplicationId when the surface is ready to be shown.
173− interval: 0// 1500
173+ interval: 1500
174 repeat: false
174 repeat: false
175 onTriggered: {
175 onTriggered: {
176 priv.applicationStarting = false;
176 priv.applicationStarting = false;
tests/mocks/Unity/Application/ApplicationInfo.cpp+10−2
@@ -26,25 +26,27 @@ ApplicationInfo::ApplicationInfo(const QString &appId, QObject *parent)
26 : ApplicationInfoInterface(appId, parent)
26 : ApplicationInfoInterface(appId, parent)
27 ,m_appId(appId)
27 ,m_appId(appId)
28 ,m_stage(MainStage)
28 ,m_stage(MainStage)
29− ,m_state(Running)
29+ ,m_state(Starting)
30 ,m_focused(false)
30 ,m_focused(false)
31 ,m_fullscreen(false)
31 ,m_fullscreen(false)
32 ,m_windowItem(0)
32 ,m_windowItem(0)
33 ,m_windowComponent(0)
33 ,m_windowComponent(0)
34 ,m_parentItem(0)
34 ,m_parentItem(0)
35{
35{
36+ QTimer::singleShot(300, this, SLOT(setRunning()));
36}
37}
37
38
38ApplicationInfo::ApplicationInfo(QObject *parent)
39ApplicationInfo::ApplicationInfo(QObject *parent)
39 : ApplicationInfoInterface(QString(), parent)
40 : ApplicationInfoInterface(QString(), parent)
40 ,m_stage(MainStage)
41 ,m_stage(MainStage)
41− ,m_state(Running)
42+ ,m_state(Starting)
42 ,m_focused(false)
43 ,m_focused(false)
43 ,m_fullscreen(false)
44 ,m_fullscreen(false)
44 ,m_windowItem(0)
45 ,m_windowItem(0)
45 ,m_windowComponent(0)
46 ,m_windowComponent(0)
46 ,m_parentItem(0)
47 ,m_parentItem(0)
47{
48{
49+ QTimer::singleShot(300, this, SLOT(setRunning()));
48}
50}
49
51
50void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status status)
52void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status status)
@@ -53,6 +55,12 @@ void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status statu
53 doCreateWindowItem();
55 doCreateWindowItem();
54}
56}
55
57
58+void ApplicationInfo::setRunning()
59+{
60+ m_state = Running;
61+ Q_EMIT stateChanged();
62+}
63+
56void ApplicationInfo::createWindowComponent()
64void ApplicationInfo::createWindowComponent()
57{
65{
58 // The assumptions I make here really should hold.
66 // The assumptions I make here really should hold.
tests/mocks/Unity/Application/ApplicationInfo.h+1
@@ -84,6 +84,7 @@ class ApplicationInfo : public ApplicationInfoInterface {
84
84
85 private Q_SLOTS:
85 private Q_SLOTS:
86 void onWindowComponentStatusChanged(QQmlComponent::Status status);
86 void onWindowComponentStatusChanged(QQmlComponent::Status status);
87+ void setRunning();
87
88
88 private:
89 private:
89 void createWindowItem();
90 void createWindowItem();