Merge lp:~dandrader/qtmir/detachPromptSurfaces into lp:qtmir
- detachPromptSurfaces
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~dandrader/qtmir/detachPromptSurfaces | ||||
Merge into: | lp:qtmir | ||||
Prerequisite: | lp:~dandrader/qtmir/fixProxySurfaceListCount | ||||
Diff against target: |
397 lines (+44/-88) 14 files modified
debian/control (+2/-2) debian/gles-patches/convert-to-gles.patch (+1/-1) src/modules/Unity/Application/application.cpp (+7/-0) src/modules/Unity/Application/application.h (+2/-0) src/modules/Unity/Application/mirsurface.cpp (+0/-5) src/modules/Unity/Application/mirsurface.h (+0/-4) src/modules/Unity/Application/mirsurfacelistmodel.cpp (+11/-0) src/modules/Unity/Application/session.cpp (+12/-24) src/modules/Unity/Application/session.h (+2/-5) src/modules/Unity/Application/session_interface.h (+3/-0) tests/framework/fake_mirsurface.h (+0/-4) tests/framework/fake_session.cpp (+2/-0) tests/framework/fake_session.h (+2/-0) tests/modules/SessionManager/session_test.cpp (+0/-43) |
||||
To merge this branch: | bzr merge lp:~dandrader/qtmir/detachPromptSurfaces | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nick Dedekind (community) | Needs Fixing | ||
Unity8 CI Bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+294954@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-05-18.
Commit message
Move prompt surfaces from MirSurface to Application and emit firstChanged signal
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable
- 489. By Daniel d'Andrada
-
Update unity-api versions
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:489
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 490. By Daniel d'Andrada
-
Fix code
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:490
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Nick Dedekind (nick-dedekind) : | # |
Daniel d'Andrada (dandrader) wrote : | # |
Replied to inline comment
Unmerged revisions
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2016-04-28 12:48:42 +0000 | |||
3 | +++ debian/control 2016-05-17 19:58:11 +0000 | |||
4 | @@ -22,7 +22,7 @@ | |||
5 | 22 | libubuntu-app-launch2-dev (>= 0.9), | 22 | libubuntu-app-launch2-dev (>= 0.9), |
6 | 23 | libubuntu-application-api-dev (>= 2.1.0), | 23 | libubuntu-application-api-dev (>= 2.1.0), |
7 | 24 | libudev-dev, | 24 | libudev-dev, |
9 | 25 | libunity-api-dev (>= 7.110), | 25 | libunity-api-dev (>= 7.112), |
10 | 26 | liburl-dispatcher1-dev, | 26 | liburl-dispatcher1-dev, |
11 | 27 | libxkbcommon-dev, | 27 | libxkbcommon-dev, |
12 | 28 | libxrender-dev, | 28 | libxrender-dev, |
13 | @@ -93,7 +93,7 @@ | |||
14 | 93 | Conflicts: libqtmir, | 93 | Conflicts: libqtmir, |
15 | 94 | libunity-mir1, | 94 | libunity-mir1, |
16 | 95 | Provides: unity-application-impl, | 95 | Provides: unity-application-impl, |
18 | 96 | unity-application-impl-15, | 96 | unity-application-impl-16, |
19 | 97 | Description: Qt plugin for Unity specific Mir APIs | 97 | Description: Qt plugin for Unity specific Mir APIs |
20 | 98 | QtMir provides Qt/QML bindings for Mir features that are exposed through the | 98 | QtMir provides Qt/QML bindings for Mir features that are exposed through the |
21 | 99 | qtmir-desktop or qtmir-android QPA plugin such as Application management | 99 | qtmir-desktop or qtmir-android QPA plugin such as Application management |
22 | 100 | 100 | ||
23 | === modified file 'debian/gles-patches/convert-to-gles.patch' | |||
24 | --- debian/gles-patches/convert-to-gles.patch 2016-04-06 18:12:31 +0000 | |||
25 | +++ debian/gles-patches/convert-to-gles.patch 2016-05-17 19:58:11 +0000 | |||
26 | @@ -84,7 +84,7 @@ | |||
27 | 84 | -Conflicts: libqtmir, | 84 | -Conflicts: libqtmir, |
28 | 85 | - libunity-mir1, | 85 | - libunity-mir1, |
29 | 86 | -Provides: unity-application-impl, | 86 | -Provides: unity-application-impl, |
31 | 87 | - unity-application-impl-15, | 87 | - unity-application-impl-16, |
32 | 88 | -Description: Qt plugin for Unity specific Mir APIs | 88 | -Description: Qt plugin for Unity specific Mir APIs |
33 | 89 | - QtMir provides Qt/QML bindings for Mir features that are exposed through the | 89 | - QtMir provides Qt/QML bindings for Mir features that are exposed through the |
34 | 90 | - qtmir-desktop or qtmir-android QPA plugin such as Application management | 90 | - qtmir-desktop or qtmir-android QPA plugin such as Application management |
35 | 91 | 91 | ||
36 | === modified file 'src/modules/Unity/Application/application.cpp' | |||
37 | --- src/modules/Unity/Application/application.cpp 2016-04-26 08:56:36 +0000 | |||
38 | +++ src/modules/Unity/Application/application.cpp 2016-05-17 19:58:11 +0000 | |||
39 | @@ -486,6 +486,7 @@ | |||
40 | 486 | 486 | ||
41 | 487 | if (m_session) { | 487 | if (m_session) { |
42 | 488 | m_proxySurfaceList.setSourceList(nullptr); | 488 | m_proxySurfaceList.setSourceList(nullptr); |
43 | 489 | m_proxyPromptSurfaceList.setSourceList(nullptr); | ||
44 | 489 | m_session->disconnect(this); | 490 | m_session->disconnect(this); |
45 | 490 | m_session->surfaceList()->disconnect(this); | 491 | m_session->surfaceList()->disconnect(this); |
46 | 491 | m_session->setApplication(nullptr); | 492 | m_session->setApplication(nullptr); |
47 | @@ -527,6 +528,7 @@ | |||
48 | 527 | Q_EMIT fullscreenChanged(fullscreen()); | 528 | Q_EMIT fullscreenChanged(fullscreen()); |
49 | 528 | 529 | ||
50 | 529 | m_proxySurfaceList.setSourceList(m_session->surfaceList()); | 530 | m_proxySurfaceList.setSourceList(m_session->surfaceList()); |
51 | 531 | m_proxyPromptSurfaceList.setSourceList(m_session->promptSurfaceList()); | ||
52 | 530 | } else { | 532 | } else { |
53 | 531 | // this can only happen after the session has stopped | 533 | // this can only happen after the session has stopped |
54 | 532 | Q_ASSERT(m_state == InternalState::Stopped || m_state == InternalState::StoppedResumable | 534 | Q_ASSERT(m_state == InternalState::Stopped || m_state == InternalState::StoppedResumable |
55 | @@ -829,6 +831,11 @@ | |||
56 | 829 | return &m_proxySurfaceList; | 831 | return &m_proxySurfaceList; |
57 | 830 | } | 832 | } |
58 | 831 | 833 | ||
59 | 834 | unityapp::MirSurfaceListInterface* Application::promptSurfaceList() | ||
60 | 835 | { | ||
61 | 836 | return &m_proxyPromptSurfaceList; | ||
62 | 837 | } | ||
63 | 838 | |||
64 | 832 | void Application::requestFocus() | 839 | void Application::requestFocus() |
65 | 833 | { | 840 | { |
66 | 834 | if (m_proxySurfaceList.rowCount() > 0) { | 841 | if (m_proxySurfaceList.rowCount() > 0) { |
67 | 835 | 842 | ||
68 | === modified file 'src/modules/Unity/Application/application.h' | |||
69 | --- src/modules/Unity/Application/application.h 2016-04-26 08:56:36 +0000 | |||
70 | +++ src/modules/Unity/Application/application.h 2016-05-17 19:58:11 +0000 | |||
71 | @@ -109,6 +109,7 @@ | |||
72 | 109 | QSize initialSurfaceSize() const override; | 109 | QSize initialSurfaceSize() const override; |
73 | 110 | void setInitialSurfaceSize(const QSize &size) override; | 110 | void setInitialSurfaceSize(const QSize &size) override; |
74 | 111 | unity::shell::application::MirSurfaceListInterface* surfaceList() override; | 111 | unity::shell::application::MirSurfaceListInterface* surfaceList() override; |
75 | 112 | unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override; | ||
76 | 112 | 113 | ||
77 | 113 | ProcessState processState() const { return m_processState; } | 114 | ProcessState processState() const { return m_processState; } |
78 | 114 | void setProcessState(ProcessState value); | 115 | void setProcessState(ProcessState value); |
79 | @@ -191,6 +192,7 @@ | |||
80 | 191 | bool m_closing{false}; | 192 | bool m_closing{false}; |
81 | 192 | 193 | ||
82 | 193 | ProxySurfaceListModel m_proxySurfaceList; | 194 | ProxySurfaceListModel m_proxySurfaceList; |
83 | 195 | ProxySurfaceListModel m_proxyPromptSurfaceList; | ||
84 | 194 | 196 | ||
85 | 195 | friend class ApplicationManager; | 197 | friend class ApplicationManager; |
86 | 196 | friend class SessionManager; | 198 | friend class SessionManager; |
87 | 197 | 199 | ||
88 | === modified file 'src/modules/Unity/Application/mirsurface.cpp' | |||
89 | --- src/modules/Unity/Application/mirsurface.cpp 2016-04-26 08:30:26 +0000 | |||
90 | +++ src/modules/Unity/Application/mirsurface.cpp 2016-05-17 19:58:11 +0000 | |||
91 | @@ -956,11 +956,6 @@ | |||
92 | 956 | return m_focused; | 956 | return m_focused; |
93 | 957 | } | 957 | } |
94 | 958 | 958 | ||
95 | 959 | unity::shell::application::MirSurfaceListInterface* MirSurface::promptSurfaceList() | ||
96 | 960 | { | ||
97 | 961 | return &m_promptSurfaceList; | ||
98 | 962 | } | ||
99 | 963 | |||
100 | 964 | void MirSurface::requestFocus() | 959 | void MirSurface::requestFocus() |
101 | 965 | { | 960 | { |
102 | 966 | DEBUG_MSG << "()"; | 961 | DEBUG_MSG << "()"; |
103 | 967 | 962 | ||
104 | === modified file 'src/modules/Unity/Application/mirsurface.h' | |||
105 | --- src/modules/Unity/Application/mirsurface.h 2016-04-26 08:30:26 +0000 | |||
106 | +++ src/modules/Unity/Application/mirsurface.h 2016-05-17 19:58:11 +0000 | |||
107 | @@ -88,8 +88,6 @@ | |||
108 | 88 | 88 | ||
109 | 89 | bool focused() const override; | 89 | bool focused() const override; |
110 | 90 | 90 | ||
111 | 91 | unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override; | ||
112 | 92 | |||
113 | 93 | Q_INVOKABLE void requestFocus() override; | 91 | Q_INVOKABLE void requestFocus() override; |
114 | 94 | Q_INVOKABLE void close() override; | 92 | Q_INVOKABLE void close() override; |
115 | 95 | Q_INVOKABLE void raise() override; | 93 | Q_INVOKABLE void raise() override; |
116 | @@ -229,8 +227,6 @@ | |||
117 | 229 | }; | 227 | }; |
118 | 230 | ClosingState m_closingState{NotClosing}; | 228 | ClosingState m_closingState{NotClosing}; |
119 | 231 | AbstractTimer *m_closeTimer{nullptr}; | 229 | AbstractTimer *m_closeTimer{nullptr}; |
120 | 232 | |||
121 | 233 | MirSurfaceListModel m_promptSurfaceList; | ||
122 | 234 | }; | 230 | }; |
123 | 235 | 231 | ||
124 | 236 | } // namespace qtmir | 232 | } // namespace qtmir |
125 | 237 | 233 | ||
126 | === modified file 'src/modules/Unity/Application/mirsurfacelistmodel.cpp' | |||
127 | --- src/modules/Unity/Application/mirsurfacelistmodel.cpp 2016-05-17 19:58:11 +0000 | |||
128 | +++ src/modules/Unity/Application/mirsurfacelistmodel.cpp 2016-05-17 19:58:11 +0000 | |||
129 | @@ -68,6 +68,7 @@ | |||
130 | 68 | Q_EMIT countChanged(); | 68 | Q_EMIT countChanged(); |
131 | 69 | if (count() == 1) { | 69 | if (count() == 1) { |
132 | 70 | Q_EMIT emptyChanged(); | 70 | Q_EMIT emptyChanged(); |
133 | 71 | Q_EMIT firstChanged(); | ||
134 | 71 | } | 72 | } |
135 | 72 | } | 73 | } |
136 | 73 | 74 | ||
137 | @@ -88,6 +89,9 @@ | |||
138 | 88 | if (count() == 0) { | 89 | if (count() == 0) { |
139 | 89 | Q_EMIT emptyChanged(); | 90 | Q_EMIT emptyChanged(); |
140 | 90 | } | 91 | } |
141 | 92 | if (i == 0) { | ||
142 | 93 | Q_EMIT firstChanged(); | ||
143 | 94 | } | ||
144 | 91 | } | 95 | } |
145 | 92 | } | 96 | } |
146 | 93 | 97 | ||
147 | @@ -105,6 +109,10 @@ | |||
148 | 105 | m_surfaceList.move(from, to); | 109 | m_surfaceList.move(from, to); |
149 | 106 | endMoveRows(); | 110 | endMoveRows(); |
150 | 107 | } | 111 | } |
151 | 112 | |||
152 | 113 | if ((from == 0 || to == 0) && m_surfaceList.count() > 1) { | ||
153 | 114 | Q_EMIT firstChanged(); | ||
154 | 115 | } | ||
155 | 108 | } | 116 | } |
156 | 109 | 117 | ||
157 | 110 | unityapp::MirSurfaceInterface *MirSurfaceListModel::get(int index) | 118 | unityapp::MirSurfaceInterface *MirSurfaceListModel::get(int index) |
158 | @@ -143,6 +151,7 @@ | |||
159 | 143 | if (wasEmpty) { | 151 | if (wasEmpty) { |
160 | 144 | Q_EMIT emptyChanged(); | 152 | Q_EMIT emptyChanged(); |
161 | 145 | } | 153 | } |
162 | 154 | Q_EMIT firstChanged(); | ||
163 | 146 | } | 155 | } |
164 | 147 | 156 | ||
165 | 148 | void MirSurfaceListModel::addSurfaceList(MirSurfaceListModel *surfaceListModel) | 157 | void MirSurfaceListModel::addSurfaceList(MirSurfaceListModel *surfaceListModel) |
166 | @@ -233,6 +242,8 @@ | |||
167 | 233 | connect(m_sourceList, &QObject::destroyed, this, [this]() { this->setSourceList(nullptr); }); | 242 | connect(m_sourceList, &QObject::destroyed, this, [this]() { this->setSourceList(nullptr); }); |
168 | 234 | connect(m_sourceList, &unityapp::MirSurfaceListInterface::countChanged, | 243 | connect(m_sourceList, &unityapp::MirSurfaceListInterface::countChanged, |
169 | 235 | this, &unityapp::MirSurfaceListInterface::countChanged); | 244 | this, &unityapp::MirSurfaceListInterface::countChanged); |
170 | 245 | connect(m_sourceList, &unityapp::MirSurfaceListInterface::firstChanged, | ||
171 | 246 | this, &unityapp::MirSurfaceListInterface::firstChanged); | ||
172 | 236 | } | 247 | } |
173 | 237 | 248 | ||
174 | 238 | endResetModel(); | 249 | endResetModel(); |
175 | 239 | 250 | ||
176 | === modified file 'src/modules/Unity/Application/session.cpp' | |||
177 | --- src/modules/Unity/Application/session.cpp 2016-05-10 20:13:37 +0000 | |||
178 | +++ src/modules/Unity/Application/session.cpp 2016-05-17 19:58:11 +0000 | |||
179 | @@ -137,6 +137,11 @@ | |||
180 | 137 | return &m_surfaceList; | 137 | return &m_surfaceList; |
181 | 138 | } | 138 | } |
182 | 139 | 139 | ||
183 | 140 | MirSurfaceListModel* Session::promptSurfaceList() | ||
184 | 141 | { | ||
185 | 142 | return &m_promptSurfaceList; | ||
186 | 143 | } | ||
187 | 144 | |||
188 | 140 | Session::State Session::state() const | 145 | Session::State Session::state() const |
189 | 141 | { | 146 | { |
190 | 142 | return m_state; | 147 | return m_state; |
191 | @@ -199,14 +204,8 @@ | |||
192 | 199 | if (newSurface->isFirstFrameDrawn()) { | 204 | if (newSurface->isFirstFrameDrawn()) { |
193 | 200 | prependSurface(newSurface); | 205 | prependSurface(newSurface); |
194 | 201 | } else { | 206 | } else { |
195 | 202 | m_blankSurfaces.append(newSurface); | ||
196 | 203 | connect(newSurface, &QObject::destroyed, this, [this, newSurface]() | ||
197 | 204 | { | ||
198 | 205 | this->m_blankSurfaces.removeAll(newSurface); | ||
199 | 206 | }); | ||
200 | 207 | connect(newSurface, &MirSurfaceInterface::firstFrameDrawn, this, [this, newSurface]() | 207 | connect(newSurface, &MirSurfaceInterface::firstFrameDrawn, this, [this, newSurface]() |
201 | 208 | { | 208 | { |
202 | 209 | this->m_blankSurfaces.removeAll(newSurface); | ||
203 | 210 | newSurface->disconnect(this); | 209 | newSurface->disconnect(this); |
204 | 211 | this->prependSurface(newSurface); | 210 | this->prependSurface(newSurface); |
205 | 212 | }); | 211 | }); |
206 | @@ -393,32 +392,19 @@ | |||
207 | 393 | void Session::addChildSession(SessionInterface* session) | 392 | void Session::addChildSession(SessionInterface* session) |
208 | 394 | { | 393 | { |
209 | 395 | insertChildSession(m_children->rowCount(), session); | 394 | insertChildSession(m_children->rowCount(), session); |
210 | 396 | |||
211 | 397 | if (m_surfaceList.count() > 0) { | ||
212 | 398 | // we assume that the top-most surface is the one that caused the prompt session to show up. | ||
213 | 399 | auto promptSurfaceList = static_cast<MirSurfaceListModel*>(m_surfaceList.get(0)->promptSurfaceList()); | ||
214 | 400 | promptSurfaceList->addSurfaceList(session->surfaceList()); | ||
215 | 401 | } else if (m_blankSurfaces.count() > 0) { | ||
216 | 402 | // Prompt session came in too early. | ||
217 | 403 | // Parent session might be blocked until the prompt session is dismissed. | ||
218 | 404 | // So we cannot wait anymore and must put that blank surface on the surface list so that the | ||
219 | 405 | // user can see the prompt surface on top of that it and interact. | ||
220 | 406 | auto blankSurface = m_blankSurfaces.takeFirst(); | ||
221 | 407 | |||
222 | 408 | auto promptSurfaceList = static_cast<MirSurfaceListModel*>(blankSurface->promptSurfaceList()); | ||
223 | 409 | promptSurfaceList->addSurfaceList(session->surfaceList()); | ||
224 | 410 | |||
225 | 411 | blankSurface->disconnect(this); | ||
226 | 412 | prependSurface(blankSurface); | ||
227 | 413 | } | ||
228 | 414 | } | 395 | } |
229 | 415 | 396 | ||
230 | 416 | void Session::insertChildSession(uint index, SessionInterface* session) | 397 | void Session::insertChildSession(uint index, SessionInterface* session) |
231 | 417 | { | 398 | { |
232 | 418 | qCDebug(QTMIR_SESSIONS) << "Session::insertChildSession - " << session->name() << " to " << name() << " @ " << index; | 399 | qCDebug(QTMIR_SESSIONS) << "Session::insertChildSession - " << session->name() << " to " << name() << " @ " << index; |
233 | 400 | Q_ASSERT(!m_children->contains(session)); | ||
234 | 419 | 401 | ||
235 | 420 | m_children->insert(index, session); | 402 | m_children->insert(index, session); |
236 | 421 | 403 | ||
237 | 404 | // Flatten the list of prompt surfaces | ||
238 | 405 | m_promptSurfaceList.addSurfaceList(session->surfaceList()); | ||
239 | 406 | m_promptSurfaceList.addSurfaceList(session->promptSurfaceList()); | ||
240 | 407 | |||
241 | 422 | connect(session, &QObject::destroyed, this, [this, session]() { this->removeChildSession(session); }); | 408 | connect(session, &QObject::destroyed, this, [this, session]() { this->removeChildSession(session); }); |
242 | 423 | 409 | ||
243 | 424 | switch (m_state) { | 410 | switch (m_state) { |
244 | @@ -444,6 +430,8 @@ | |||
245 | 444 | 430 | ||
246 | 445 | if (m_children->contains(session)) { | 431 | if (m_children->contains(session)) { |
247 | 446 | m_children->remove(session); | 432 | m_children->remove(session); |
248 | 433 | m_promptSurfaceList.removeSurfaceList(session->surfaceList()); | ||
249 | 434 | m_promptSurfaceList.removeSurfaceList(session->promptSurfaceList()); | ||
250 | 447 | } | 435 | } |
251 | 448 | 436 | ||
252 | 449 | deleteIfZombieAndEmpty(); | 437 | deleteIfZombieAndEmpty(); |
253 | 450 | 438 | ||
254 | === modified file 'src/modules/Unity/Application/session.h' | |||
255 | --- src/modules/Unity/Application/session.h 2016-05-10 20:13:37 +0000 | |||
256 | +++ src/modules/Unity/Application/session.h 2016-05-17 19:58:11 +0000 | |||
257 | @@ -51,6 +51,7 @@ | |||
258 | 51 | QString name() const override; | 51 | QString name() const override; |
259 | 52 | unity::shell::application::ApplicationInfoInterface* application() const override; | 52 | unity::shell::application::ApplicationInfoInterface* application() const override; |
260 | 53 | MirSurfaceListModel* surfaceList() override; | 53 | MirSurfaceListModel* surfaceList() override; |
261 | 54 | MirSurfaceListModel* promptSurfaceList() override; | ||
262 | 54 | State state() const override; | 55 | State state() const override; |
263 | 55 | bool fullscreen() const override; | 56 | bool fullscreen() const override; |
264 | 56 | bool live() const override; | 57 | bool live() const override; |
265 | @@ -107,11 +108,7 @@ | |||
266 | 107 | std::shared_ptr<mir::scene::Session> m_session; | 108 | std::shared_ptr<mir::scene::Session> m_session; |
267 | 108 | Application* m_application; | 109 | Application* m_application; |
268 | 109 | MirSurfaceListModel m_surfaceList; | 110 | MirSurfaceListModel m_surfaceList; |
274 | 110 | 111 | MirSurfaceListModel m_promptSurfaceList; | |
270 | 111 | // Registered surfaces that haven't yet drawn their first frames. | ||
271 | 112 | // Once they do, they get moved to m_surfaceList. | ||
272 | 113 | // So this list is just a temporary holder and most of the time it's gonna be empty. | ||
273 | 114 | QList<MirSurfaceInterface*> m_blankSurfaces; | ||
275 | 115 | 112 | ||
276 | 116 | SessionModel* m_children; | 113 | SessionModel* m_children; |
277 | 117 | bool m_fullscreen; | 114 | bool m_fullscreen; |
278 | 118 | 115 | ||
279 | === modified file 'src/modules/Unity/Application/session_interface.h' | |||
280 | --- src/modules/Unity/Application/session_interface.h 2016-04-06 16:52:49 +0000 | |||
281 | +++ src/modules/Unity/Application/session_interface.h 2016-05-17 19:58:11 +0000 | |||
282 | @@ -68,6 +68,9 @@ | |||
283 | 68 | // List of surfaces in this session. Surfaces that are being forcibly closed are not present in this list | 68 | // List of surfaces in this session. Surfaces that are being forcibly closed are not present in this list |
284 | 69 | virtual MirSurfaceListModel* surfaceList() = 0; | 69 | virtual MirSurfaceListModel* surfaceList() = 0; |
285 | 70 | 70 | ||
286 | 71 | // List of prompt surfaces under this session (and its children) | ||
287 | 72 | virtual MirSurfaceListModel* promptSurfaceList() = 0; | ||
288 | 73 | |||
289 | 71 | virtual SessionModel* childSessions() const = 0; | 74 | virtual SessionModel* childSessions() const = 0; |
290 | 72 | virtual State state() const = 0; | 75 | virtual State state() const = 0; |
291 | 73 | virtual bool fullscreen() const = 0; | 76 | virtual bool fullscreen() const = 0; |
292 | 74 | 77 | ||
293 | === modified file 'tests/framework/fake_mirsurface.h' | |||
294 | --- tests/framework/fake_mirsurface.h 2016-04-26 08:30:26 +0000 | |||
295 | +++ tests/framework/fake_mirsurface.h 2016-05-17 19:58:11 +0000 | |||
296 | @@ -77,8 +77,6 @@ | |||
297 | 77 | 77 | ||
298 | 78 | bool focused() const override { return false; } | 78 | bool focused() const override { return false; } |
299 | 79 | 79 | ||
300 | 80 | unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override { return &m_promptSurfaceList;} | ||
301 | 81 | |||
302 | 82 | void requestFocus() override { | 80 | void requestFocus() override { |
303 | 83 | Q_EMIT focusRequested(); | 81 | Q_EMIT focusRequested(); |
304 | 84 | } | 82 | } |
305 | @@ -175,8 +173,6 @@ | |||
306 | 175 | 173 | ||
307 | 176 | QList<TouchEvent> m_touchesReceived; | 174 | QList<TouchEvent> m_touchesReceived; |
308 | 177 | 175 | ||
309 | 178 | MirSurfaceListModel m_promptSurfaceList; | ||
310 | 179 | |||
311 | 180 | SessionInterface *m_session{nullptr}; | 176 | SessionInterface *m_session{nullptr}; |
312 | 181 | }; | 177 | }; |
313 | 182 | 178 | ||
314 | 183 | 179 | ||
315 | === modified file 'tests/framework/fake_session.cpp' | |||
316 | --- tests/framework/fake_session.cpp 2016-03-28 18:02:26 +0000 | |||
317 | +++ tests/framework/fake_session.cpp 2016-05-17 19:58:11 +0000 | |||
318 | @@ -36,6 +36,8 @@ | |||
319 | 36 | 36 | ||
320 | 37 | MirSurfaceListModel* FakeSession::surfaceList() { return &m_surfaceList; } | 37 | MirSurfaceListModel* FakeSession::surfaceList() { return &m_surfaceList; } |
321 | 38 | 38 | ||
322 | 39 | MirSurfaceListModel* FakeSession::promptSurfaceList() { return &m_promptSurfaceList; } | ||
323 | 40 | |||
324 | 39 | SessionModel *FakeSession::childSessions() const { return nullptr; } | 41 | SessionModel *FakeSession::childSessions() const { return nullptr; } |
325 | 40 | 42 | ||
326 | 41 | SessionInterface::State FakeSession::state() const { return m_state; } | 43 | SessionInterface::State FakeSession::state() const { return m_state; } |
327 | 42 | 44 | ||
328 | === modified file 'tests/framework/fake_session.h' | |||
329 | --- tests/framework/fake_session.h 2016-03-28 18:02:26 +0000 | |||
330 | +++ tests/framework/fake_session.h 2016-05-17 19:58:11 +0000 | |||
331 | @@ -34,6 +34,7 @@ | |||
332 | 34 | QString name() const override; | 34 | QString name() const override; |
333 | 35 | unity::shell::application::ApplicationInfoInterface* application() const override; | 35 | unity::shell::application::ApplicationInfoInterface* application() const override; |
334 | 36 | MirSurfaceListModel* surfaceList() override; | 36 | MirSurfaceListModel* surfaceList() override; |
335 | 37 | MirSurfaceListModel* promptSurfaceList() override; | ||
336 | 37 | SessionModel* childSessions() const override; | 38 | SessionModel* childSessions() const override; |
337 | 38 | State state() const override; | 39 | State state() const override; |
338 | 39 | bool fullscreen() const override; | 40 | bool fullscreen() const override; |
339 | @@ -81,6 +82,7 @@ | |||
340 | 81 | State m_state; | 82 | State m_state; |
341 | 82 | std::shared_ptr<mir::scene::Session> m_session; | 83 | std::shared_ptr<mir::scene::Session> m_session; |
342 | 83 | MirSurfaceListModel m_surfaceList; | 84 | MirSurfaceListModel m_surfaceList; |
343 | 85 | MirSurfaceListModel m_promptSurfaceList; | ||
344 | 84 | }; | 86 | }; |
345 | 85 | 87 | ||
346 | 86 | } // namespace qtmi | 88 | } // namespace qtmi |
347 | 87 | 89 | ||
348 | === modified file 'tests/modules/SessionManager/session_test.cpp' | |||
349 | --- tests/modules/SessionManager/session_test.cpp 2016-05-10 20:13:37 +0000 | |||
350 | +++ tests/modules/SessionManager/session_test.cpp 2016-05-17 19:58:11 +0000 | |||
351 | @@ -311,46 +311,3 @@ | |||
352 | 311 | EXPECT_EQ(Session::Stopped, session->state()); | 311 | EXPECT_EQ(Session::Stopped, session->state()); |
353 | 312 | EXPECT_FALSE(session->m_suspendTimer->isRunning()); | 312 | EXPECT_FALSE(session->m_suspendTimer->isRunning()); |
354 | 313 | } | 313 | } |
355 | 314 | |||
356 | 315 | /* | ||
357 | 316 | Regression test for https://bugs.launchpad.net/ubuntu/+source/qtmir/+bug/1578665 | ||
358 | 317 | |||
359 | 318 | A child prompt session was arriving before the application surface got a chance to draw | ||
360 | 319 | its first frame. And on top of that, the application was blocked from drawing anything | ||
361 | 320 | until that prompt session gone away. | ||
362 | 321 | */ | ||
363 | 322 | TEST_F(SessionTests, ChildSessionArrivesBeforeSurfaceDrawnFirstFrame) | ||
364 | 323 | { | ||
365 | 324 | using namespace testing; | ||
366 | 325 | |||
367 | 326 | const QString appId("test-app"); | ||
368 | 327 | const pid_t procId = 5551; | ||
369 | 328 | |||
370 | 329 | auto mirSession = std::make_shared<MockSession>(appId.toStdString(), procId); | ||
371 | 330 | |||
372 | 331 | auto session = std::make_shared<qtmir::Session>(mirSession, promptSessionManager); | ||
373 | 332 | |||
374 | 333 | FakeMirSurface *blankSurface = new FakeMirSurface; | ||
375 | 334 | session->registerSurface(blankSurface); | ||
376 | 335 | |||
377 | 336 | // Surface doesn't appear in this list as it has not drawn its first frame yet | ||
378 | 337 | EXPECT_EQ(0, session->surfaceList()->count()); | ||
379 | 338 | |||
380 | 339 | Session* childSession = new Session(mirSession, promptSessionManager); | ||
381 | 340 | session->addChildSession(childSession); | ||
382 | 341 | |||
383 | 342 | FakeMirSurface *promptSurface = new FakeMirSurface; | ||
384 | 343 | childSession->registerSurface(promptSurface); | ||
385 | 344 | promptSurface->drawFirstFrame(); | ||
386 | 345 | |||
387 | 346 | // Even though blankSurface still hasn't drawn its first frame (ie, it's still blank), | ||
388 | 347 | // it should now appear in this list as it now has a child prompt surface, which the | ||
389 | 348 | // user must interact with. | ||
390 | 349 | auto sessionSurfaceList = static_cast<MirSurfaceListModel*>(session->surfaceList()); | ||
391 | 350 | EXPECT_EQ(1, sessionSurfaceList->count()); | ||
392 | 351 | EXPECT_TRUE(sessionSurfaceList->contains(blankSurface)); | ||
393 | 352 | |||
394 | 353 | auto promptSurfaceList = static_cast<MirSurfaceListModel*>(blankSurface->promptSurfaceList()); | ||
395 | 354 | EXPECT_EQ(1, promptSurfaceList->count()); | ||
396 | 355 | EXPECT_TRUE(promptSurfaceList->contains(promptSurface)); | ||
397 | 356 | } |
FAILED: Continuous integration, rev:488 /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/223/ /unity8- jenkins. ubuntu. com/job/ build-0- fetch/1650 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 1603 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 1603 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1596/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1596/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1596/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1596/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1596/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1596/console
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/223/ rebuild
https:/