Merge lp:~unity-team/qtmir/surfaceDrawn into lp:qtmir

Proposed by Nick Dedekind
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~unity-team/qtmir/surfaceDrawn
Merge into: lp:qtmir
Diff against target: 464 lines (+41/-75)
18 files modified
CMakeLists.txt (+1/-1)
debian/control (+2/-2)
debian/gles-patches/convert-to-gles.patch (+9/-9)
src/modules/Unity/Application/mirsurface.cpp (+1/-1)
src/modules/Unity/Application/mirsurface.h (+2/-2)
src/modules/Unity/Application/mirsurfaceinterface.h (+0/-3)
src/modules/Unity/Application/mirsurfacemanager.cpp (+2/-6)
src/modules/Unity/Application/session.cpp (+0/-22)
src/modules/Unity/Application/session.h (+1/-3)
src/modules/Unity/Application/session_interface.h (+1/-1)
tests/framework/fake_mirsurface.cpp (+2/-2)
tests/framework/fake_mirsurface.h (+2/-1)
tests/framework/fake_session.cpp (+1/-1)
tests/framework/fake_session.h (+1/-1)
tests/framework/mock_session.h (+1/-1)
tests/modules/Application/application_test.cpp (+8/-8)
tests/modules/ApplicationManager/application_manager_test.cpp (+1/-1)
tests/modules/SessionManager/session_test.cpp (+6/-10)
To merge this branch: bzr merge lp:~unity-team/qtmir/surfaceDrawn
Reviewer Review Type Date Requested Status
Michał Sawicz Disapprove
Unity8 CI Bot (community) continuous-integration Needs Fixing
Nick Dedekind code Pending
Review via email: mp+294467@code.launchpad.net

This proposal supersedes a proposal from 2016-05-11.

Commit message

Implement MirSurface.drawn property

And no longer hide blank surfaces from shell

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~dandrader/unity8/surfaceDrawn/+merge/294427
https://code.launchpad.net/~dandrader/unity-api/surfaceDrawn/+merge/294426

* 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?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal

Code looks fine. Will test when silo built.
https://requests.ci-train.ubuntu.com/#/ticket/1409

review: Approve (code)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~unity-team/qtmir/surfaceDrawn updated
487. By Nick Dedekind

gles

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

We've landed the original workaround, please merge trunk.

lp:~unity-team/qtmir/surfaceDrawn updated
488. By Nick Dedekind

merged with trunk

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

This is not enough for bug 1581559

review: Disapprove

Unmerged revisions

488. By Nick Dedekind

merged with trunk

487. By Nick Dedekind

gles

486. By Daniel d'Andrada

Update test

485. By Daniel d'Andrada

Implement MirSurface.drawn property

And no longer hide blank surfaces from shell

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-04-26 07:20:33 +0000
3+++ CMakeLists.txt 2016-05-13 15:29:08 +0000
4@@ -76,7 +76,7 @@
5 pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
6 pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED)
7 pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED)
8-pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=15)
9+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=16)
10
11 include_directories(${APPLICATION_API_INCLUDE_DIRS})
12
13
14=== modified file 'debian/control'
15--- debian/control 2016-04-28 12:48:42 +0000
16+++ debian/control 2016-05-13 15:29:08 +0000
17@@ -22,7 +22,7 @@
18 libubuntu-app-launch2-dev (>= 0.9),
19 libubuntu-application-api-dev (>= 2.1.0),
20 libudev-dev,
21- libunity-api-dev (>= 7.110),
22+ libunity-api-dev (>= 7.112),
23 liburl-dispatcher1-dev,
24 libxkbcommon-dev,
25 libxrender-dev,
26@@ -93,7 +93,7 @@
27 Conflicts: libqtmir,
28 libunity-mir1,
29 Provides: unity-application-impl,
30- unity-application-impl-15,
31+ unity-application-impl-16,
32 Description: Qt plugin for Unity specific Mir APIs
33 QtMir provides Qt/QML bindings for Mir features that are exposed through the
34 qtmir-desktop or qtmir-android QPA plugin such as Application management
35
36=== modified file 'debian/gles-patches/convert-to-gles.patch'
37--- debian/gles-patches/convert-to-gles.patch 2016-04-06 18:12:31 +0000
38+++ debian/gles-patches/convert-to-gles.patch 2016-05-13 15:29:08 +0000
39@@ -1,7 +1,7 @@
40-Index: inline-gles-quilt/debian/control
41+Index: surfaceDrawn/debian/control
42 ===================================================================
43---- inline-gles-quilt.orig/debian/control
44-+++ inline-gles-quilt/debian/control
45+--- surfaceDrawn.orig/debian/control
46++++ surfaceDrawn/debian/control
47 @@ -1,4 +1,4 @@
48 -Source: qtmir
49 +Source: qtmir-gles
50@@ -9,7 +9,7 @@
51 Priority: optional
52 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
53 @@ -16,7 +16,13 @@ Build-Depends: cmake,
54- libmirserver-dev (>= 0.19.0),
55+ libmirserver-dev (>= 0.22.0),
56 libmtdev-dev,
57 libprocess-cpp-dev,
58 + libqt5gui5-gles,
59@@ -21,7 +21,7 @@
60 + libqt5test5,
61 libqtdbusmock1-dev (>= 0.2),
62 libqtdbustest1-dev (>= 0.2),
63- libubuntu-app-launch2-dev,
64+ libubuntu-app-launch2-dev (>= 0.9),
65 @@ -31,8 +37,8 @@ Build-Depends: cmake,
66 # lttng-gen-ts needs python3, but doesn't depend on it itself: bug 1359147
67 python3:any,
68@@ -84,7 +84,7 @@
69 -Conflicts: libqtmir,
70 - libunity-mir1,
71 -Provides: unity-application-impl,
72-- unity-application-impl-15,
73+- unity-application-impl-16,
74 -Description: Qt plugin for Unity specific Mir APIs
75 - QtMir provides Qt/QML bindings for Mir features that are exposed through the
76 - qtmir-desktop or qtmir-android QPA plugin such as Application management
77@@ -111,10 +111,10 @@
78 - QtMir QPA.
79 + This variant of the package is for Android-based phones and tablets (built
80 + against the OpenGLES variant of qtbase).
81-Index: inline-gles-quilt/debian/rules
82+Index: surfaceDrawn/debian/rules
83 ===================================================================
84---- inline-gles-quilt.orig/debian/rules
85-+++ inline-gles-quilt/debian/rules
86+--- surfaceDrawn.orig/debian/rules
87++++ surfaceDrawn/debian/rules
88 @@ -3,60 +3,28 @@
89
90 export DPKG_GENSYMBOLS_CHECK_LEVEL=4
91
92=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
93--- src/modules/Unity/Application/mirsurface.cpp 2016-04-26 08:30:26 +0000
94+++ src/modules/Unity/Application/mirsurface.cpp 2016-05-13 15:29:08 +0000
95@@ -263,7 +263,7 @@
96 {
97 if (!m_firstFrameDrawn) {
98 m_firstFrameDrawn = true;
99- Q_EMIT firstFrameDrawn();
100+ Q_EMIT drawnChanged(true);
101 }
102
103 // restart the frame dropper so that items have enough time to render the next frame.
104
105=== modified file 'src/modules/Unity/Application/mirsurface.h'
106--- src/modules/Unity/Application/mirsurface.h 2016-04-26 08:30:26 +0000
107+++ src/modules/Unity/Application/mirsurface.h 2016-05-13 15:29:08 +0000
108@@ -90,6 +90,8 @@
109
110 unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override;
111
112+ bool drawn() const override { return m_firstFrameDrawn; }
113+
114 Q_INVOKABLE void requestFocus() override;
115 Q_INVOKABLE void close() override;
116 Q_INVOKABLE void raise() override;
117@@ -99,8 +101,6 @@
118
119 void setLive(bool value) override;
120
121- bool isFirstFrameDrawn() const override { return m_firstFrameDrawn; }
122-
123 void stopFrameDropper() override;
124 void startFrameDropper() override;
125
126
127=== modified file 'src/modules/Unity/Application/mirsurfaceinterface.h'
128--- src/modules/Unity/Application/mirsurfaceinterface.h 2016-04-29 15:41:00 +0000
129+++ src/modules/Unity/Application/mirsurfaceinterface.h 2016-05-13 15:29:08 +0000
130@@ -44,8 +44,6 @@
131
132 virtual void setLive(bool value) = 0;
133
134- virtual bool isFirstFrameDrawn() const = 0;
135-
136 virtual void stopFrameDropper() = 0;
137 virtual void startFrameDropper() = 0;
138
139@@ -116,7 +114,6 @@
140 void cursorChanged(const QCursor &cursor);
141 void raiseRequested();
142 void closeRequested();
143- void firstFrameDrawn();
144 void framesPosted();
145 void isBeingDisplayedChanged();
146 void frameDropped();
147
148=== modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp'
149--- src/modules/Unity/Application/mirsurfacemanager.cpp 2016-04-29 15:41:00 +0000
150+++ src/modules/Unity/Application/mirsurfacemanager.cpp 2016-05-13 15:29:08 +0000
151@@ -113,18 +113,14 @@
152 }
153
154 if (session)
155- session->registerSurface(qmlSurface);
156+ session->prependSurface(qmlSurface);
157
158 if (qmlSurface->type() == Mir::InputMethodType) {
159 m_inputMethodSurface = qmlSurface;
160 Q_EMIT inputMethodSurfaceChanged();
161 }
162
163- // Only notify QML of surface creation once it has drawn its first frame.
164- connect(qmlSurface, &MirSurfaceInterface::firstFrameDrawn, this, [=]() {
165- tracepoint(qtmir, firstFrameDrawn);
166- Q_EMIT surfaceCreated(qmlSurface);
167- });
168+ Q_EMIT surfaceCreated(qmlSurface);
169
170 // clean up after MirSurface is destroyed
171 connect(qmlSurface, &QObject::destroyed, this, [&](QObject *obj) {
172
173=== modified file 'src/modules/Unity/Application/session.cpp'
174--- src/modules/Unity/Application/session.cpp 2016-05-10 20:13:37 +0000
175+++ src/modules/Unity/Application/session.cpp 2016-05-13 15:29:08 +0000
176@@ -191,28 +191,6 @@
177 Q_EMIT applicationChanged(application);
178 }
179
180-void Session::registerSurface(MirSurfaceInterface *newSurface)
181-{
182- qCDebug(QTMIR_SESSIONS) << "Session::resgisterSurface - session=" << name() << "surface=" << newSurface;
183-
184- // Only notify QML of surface creation once it has drawn its first frame.
185- if (newSurface->isFirstFrameDrawn()) {
186- prependSurface(newSurface);
187- } else {
188- m_blankSurfaces.append(newSurface);
189- connect(newSurface, &QObject::destroyed, this, [this, newSurface]()
190- {
191- this->m_blankSurfaces.removeAll(newSurface);
192- });
193- connect(newSurface, &MirSurfaceInterface::firstFrameDrawn, this, [this, newSurface]()
194- {
195- this->m_blankSurfaces.removeAll(newSurface);
196- newSurface->disconnect(this);
197- this->prependSurface(newSurface);
198- });
199- }
200-}
201-
202 void Session::prependSurface(MirSurfaceInterface *newSurface)
203 {
204 qCDebug(QTMIR_SESSIONS) << "Session::prependSurface - session=" << name() << "surface=" << newSurface;
205
206=== modified file 'src/modules/Unity/Application/session.h'
207--- src/modules/Unity/Application/session.h 2016-05-10 20:13:37 +0000
208+++ src/modules/Unity/Application/session.h 2016-05-13 15:29:08 +0000
209@@ -57,7 +57,7 @@
210
211 void setApplication(unity::shell::application::ApplicationInfoInterface* item) override;
212
213- void registerSurface(MirSurfaceInterface* surface) override;
214+ void prependSurface(MirSurfaceInterface* surface) override;
215
216 void suspend() override;
217 void resume() override;
218@@ -102,8 +102,6 @@
219
220 void stopPromptSessions();
221
222- void prependSurface(MirSurfaceInterface* surface);
223-
224 std::shared_ptr<mir::scene::Session> m_session;
225 Application* m_application;
226 MirSurfaceListModel m_surfaceList;
227
228=== modified file 'src/modules/Unity/Application/session_interface.h'
229--- src/modules/Unity/Application/session_interface.h 2016-04-06 16:52:49 +0000
230+++ src/modules/Unity/Application/session_interface.h 2016-05-13 15:29:08 +0000
231@@ -77,7 +77,7 @@
232
233 // For MirSurface and MirSurfaceManager use
234
235- virtual void registerSurface(MirSurfaceInterface* surface) = 0;
236+ virtual void prependSurface(MirSurfaceInterface* surface) = 0;
237
238 // For Application use
239
240
241=== modified file 'tests/framework/fake_mirsurface.cpp'
242--- tests/framework/fake_mirsurface.cpp 2016-04-05 18:58:38 +0000
243+++ tests/framework/fake_mirsurface.cpp 2016-05-13 15:29:08 +0000
244@@ -91,7 +91,7 @@
245 }
246 }
247
248-bool FakeMirSurface::isFirstFrameDrawn() const
249+bool FakeMirSurface::drawn() const
250 {
251 return m_isFirstFrameDrawn;
252 }
253@@ -188,7 +188,7 @@
254 {
255 if (!m_isFirstFrameDrawn) {
256 m_isFirstFrameDrawn = true;
257- Q_EMIT firstFrameDrawn();
258+ Q_EMIT drawnChanged(true);
259 }
260 }
261
262
263=== modified file 'tests/framework/fake_mirsurface.h'
264--- tests/framework/fake_mirsurface.h 2016-04-26 08:30:26 +0000
265+++ tests/framework/fake_mirsurface.h 2016-05-13 15:29:08 +0000
266@@ -79,6 +79,8 @@
267
268 unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override { return &m_promptSurfaceList;}
269
270+ bool drawn() const override;
271+
272 void requestFocus() override {
273 Q_EMIT focusRequested();
274 }
275@@ -94,7 +96,6 @@
276 ////
277 // qtmir.MirSurfaceInterface
278
279- bool isFirstFrameDrawn() const override;
280 void stopFrameDropper() override;
281 void startFrameDropper() override;
282 void setLive(bool value) override;
283
284=== modified file 'tests/framework/fake_session.cpp'
285--- tests/framework/fake_session.cpp 2016-03-28 18:02:26 +0000
286+++ tests/framework/fake_session.cpp 2016-05-13 15:29:08 +0000
287@@ -49,7 +49,7 @@
288 return m_session;
289 }
290
291-void FakeSession::registerSurface(MirSurfaceInterface *) {}
292+void FakeSession::prependSurface(MirSurfaceInterface *) {}
293
294 void FakeSession::setApplication(unity::shell::application::ApplicationInfoInterface *app)
295 {
296
297=== modified file 'tests/framework/fake_session.h'
298--- tests/framework/fake_session.h 2016-03-28 18:02:26 +0000
299+++ tests/framework/fake_session.h 2016-05-13 15:29:08 +0000
300@@ -43,7 +43,7 @@
301
302 // For MirSurfaceItem and MirSurfaceManager use
303
304- void registerSurface(MirSurfaceInterface*) override;
305+ void prependSurface(MirSurfaceInterface*) override;
306
307 // For Application use
308
309
310=== modified file 'tests/framework/mock_session.h'
311--- tests/framework/mock_session.h 2016-03-28 18:02:26 +0000
312+++ tests/framework/mock_session.h 2016-05-13 15:29:08 +0000
313@@ -42,7 +42,7 @@
314
315 MOCK_CONST_METHOD0(session, std::shared_ptr<mir::scene::Session>());
316
317- MOCK_METHOD1(registerSurface, void(MirSurfaceInterface* surface));
318+ MOCK_METHOD1(prependSurface, void(MirSurfaceInterface* surface));
319 MOCK_METHOD1(removeSurface, void(MirSurfaceInterface* surface));
320
321 MOCK_METHOD1(setApplication, void(unity::shell::application::ApplicationInfoInterface* item));
322
323=== modified file 'tests/modules/Application/application_test.cpp'
324--- tests/modules/Application/application_test.cpp 2016-04-26 08:56:36 +0000
325+++ tests/modules/Application/application_test.cpp 2016-05-13 15:29:08 +0000
326@@ -285,7 +285,7 @@
327 QSignalSpy spyAppStopped(application.data(), SIGNAL(stopped()));
328
329 FakeMirSurface *surface = new FakeMirSurface;
330- session->registerSurface(surface);
331+ session->prependSurface(surface);
332 surface->drawFirstFrame();
333
334 ASSERT_EQ(Application::InternalState::Running, application->internalState());
335@@ -380,7 +380,7 @@
336 application->setSession(session);
337
338 FakeMirSurface *surface = new FakeMirSurface;
339- session->registerSurface(surface);
340+ session->prependSurface(surface);
341 surface->drawFirstFrame();
342
343 ASSERT_EQ(Application::InternalState::Running, application->internalState());
344@@ -388,7 +388,7 @@
345 // Add a second surface to ensure the application doesn't kill itself after it loses
346 // one surface.
347 FakeMirSurface *secondSurface = new FakeMirSurface;
348- session->registerSurface(secondSurface);
349+ session->prependSurface(secondSurface);
350 secondSurface->drawFirstFrame();
351
352 suspend(application.data());
353@@ -437,14 +437,14 @@
354 application->setSession(session);
355
356 FakeMirSurface *surface = new FakeMirSurface;
357- session->registerSurface(surface);
358+ session->prependSurface(surface);
359 surface->drawFirstFrame();
360
361 ASSERT_EQ(Application::InternalState::Running, application->internalState());
362 ASSERT_EQ(Session::Running, session->state());
363
364 FakeMirSurface *secondSurface = new FakeMirSurface;
365- session->registerSurface(secondSurface);
366+ session->prependSurface(secondSurface);
367 secondSurface->drawFirstFrame();
368
369 delete surface;
370@@ -488,7 +488,7 @@
371 application->setSession(session);
372
373 FakeMirSurface *surface = new FakeMirSurface;
374- session->registerSurface(surface);
375+ session->prependSurface(surface);
376 surface->drawFirstFrame();
377 ASSERT_EQ(Application::InternalState::Running, application->internalState());
378
379@@ -532,7 +532,7 @@
380 application->setSession(session);
381
382 FakeMirSurface *surface = new FakeMirSurface;
383- session->registerSurface(surface);
384+ session->prependSurface(surface);
385 surface->drawFirstFrame();
386 ASSERT_EQ(Application::InternalState::Running, application->internalState());
387
388@@ -570,7 +570,7 @@
389 application->setSession(session);
390
391 FakeMirSurface *surface = new FakeMirSurface;
392- session->registerSurface(surface);
393+ session->prependSurface(surface);
394 surface->drawFirstFrame();
395
396 ASSERT_EQ(Application::InternalState::Running, application->internalState());
397
398=== modified file 'tests/modules/ApplicationManager/application_manager_test.cpp'
399--- tests/modules/ApplicationManager/application_manager_test.cpp 2016-04-26 08:56:36 +0000
400+++ tests/modules/ApplicationManager/application_manager_test.cpp 2016-05-13 15:29:08 +0000
401@@ -55,7 +55,7 @@
402
403 SessionInterface* qmlSession = sessionManager.findSession(mirSession);
404 if (qmlSession) {
405- qmlSession->registerSurface(qmlSurface);
406+ qmlSession->prependSurface(qmlSurface);
407 }
408
409 // I assume that applicationManager ignores the mirSurface parameter, so sending
410
411=== modified file 'tests/modules/SessionManager/session_test.cpp'
412--- tests/modules/SessionManager/session_test.cpp 2016-05-10 20:13:37 +0000
413+++ tests/modules/SessionManager/session_test.cpp 2016-05-13 15:29:08 +0000
414@@ -43,7 +43,7 @@
415 }
416 };
417
418-TEST_F(SessionTests, FromStartingToRunningOnceSurfaceDrawsFirstFrame)
419+TEST_F(SessionTests, FromStartingToRunningOnceFirstSurfaceAppears)
420 {
421 using namespace testing;
422
423@@ -58,12 +58,8 @@
424 EXPECT_EQ(Session::Starting, session->state());
425
426 FakeMirSurface *surface = new FakeMirSurface;
427- session->registerSurface(surface);
428-
429- // Still on Starting as the surface hasn't drawn its first frame yet
430- EXPECT_EQ(Session::Starting, session->state());
431-
432- surface->drawFirstFrame();
433+ session->prependSurface(surface);
434+
435 EXPECT_EQ(Session::Running, session->state());
436 }
437
438@@ -221,7 +217,7 @@
439 auto session = std::make_shared<qtmir::Session>(mirSession, mirServer->the_prompt_session_manager());
440 {
441 FakeMirSurface *surface = new FakeMirSurface;
442- session->registerSurface(surface);
443+ session->prependSurface(surface);
444 surface->drawFirstFrame();
445 }
446 EXPECT_EQ(Session::Running, session->state());
447@@ -252,7 +248,7 @@
448 auto session = std::make_shared<qtmir::Session>(mirSession, promptSessionManager);
449 {
450 FakeMirSurface *surface = new FakeMirSurface;
451- session->registerSurface(surface);
452+ session->prependSurface(surface);
453 surface->drawFirstFrame();
454 }
455 EXPECT_EQ(Session::Running, session->state());
456@@ -297,7 +293,7 @@
457 auto session = std::make_shared<SessionTestClass>(mirSession, mirServer->the_prompt_session_manager());
458 {
459 FakeMirSurface *surface = new FakeMirSurface;
460- session->registerSurface(surface);
461+ session->prependSurface(surface);
462 surface->drawFirstFrame();
463 }
464 EXPECT_EQ(Session::Running, session->state());

Subscribers

People subscribed via source and target branches