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

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 450
Merged at revision: 464
Proposed branch: lp:~unity-team/qtmir/shell_chrome
Merge into: lp:qtmir
Prerequisite: lp:~mzanetti/qtmir/surfacemanager-getters
Diff against target: 1146 lines (+196/-124)
29 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+7/-0)
debian/control (+2/-2)
src/modules/Unity/Application/application.cpp (+2/-1)
src/modules/Unity/Application/application.h (+1/-3)
src/modules/Unity/Application/application_manager.cpp (+3/-14)
src/modules/Unity/Application/application_manager.h (+1/-11)
src/modules/Unity/Application/mirsurface.cpp (+26/-7)
src/modules/Unity/Application/mirsurface.h (+6/-3)
src/modules/Unity/Application/mirsurfaceinterface.h (+2/-0)
src/modules/Unity/Application/mirsurfaceitem.cpp (+6/-0)
src/modules/Unity/Application/mirsurfaceitem.h (+1/-0)
src/modules/Unity/Application/mirsurfacemanager.cpp (+5/-6)
src/modules/Unity/Application/mirsurfacemanager.h (+2/-2)
src/modules/Unity/Application/session.cpp (+3/-1)
src/platforms/mirserver/CMakeLists.txt (+1/-1)
src/platforms/mirserver/creationhints.cpp (+28/-5)
src/platforms/mirserver/creationhints.h (+11/-7)
src/platforms/mirserver/mirwindowmanager.cpp (+6/-7)
src/platforms/mirserver/sessionlistener.cpp (+5/-5)
src/platforms/mirserver/sessionlistener.h (+4/-4)
src/platforms/mirserver/surfaceobserver.cpp (+6/-2)
src/platforms/mirserver/surfaceobserver.h (+2/-1)
tests/framework/fake_mirsurface.h (+3/-0)
tests/framework/qtmir_test.cpp (+1/-1)
tests/mirserver/WindowManager/CMakeLists.txt (+2/-0)
tests/mirserver/WindowManager/window_manager.cpp (+26/-5)
tests/modules/ApplicationManager/application_manager_test.cpp (+29/-31)
tests/modules/SurfaceManager/mirsurface_test.cpp (+4/-4)
To merge this branch: bzr merge lp:~unity-team/qtmir/shell_chrome
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Unity8 CI Bot (community) continuous-integration Needs Fixing
Lukáš Tinkl (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+286361@code.launchpad.net

This proposal supersedes a proposal from 2016-02-17.

Commit message

Add support for low shell chrome.

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~nick-dedekind/unity-api/shell_chrome/+merge/286309
https://code.launchpad.net/~nick-dedekind/unity8/shell_chrome/+merge/286306
https://code.launchpad.net/~nick-dedekind/qtubuntu/shell_chrome/+merge/286308

 * 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
PS Jenkins bot (ps-jenkins) 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 :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

As I said in the unity-api MP, I don't understand what you mean by "shell chrome" and suspect there might be better terminology.

Am happy to see the ExecFlags stuff going away.

+void MirSurfaceManager::onSurfaceModified(const std::shared_ptr<mir::scene::Surface> & surface,
nitpick - have the & beside the variable name.

In this method, I'm not convinced why mutex needed. This will be called on the GUI thread, since it a slot connected to via a queued connection.

You've a blank line after the if statement here too.

+++ src/modules/Unity/Application/mirsurfacemanager.h
+ const QVariant& value);
nitpick - & beside the var name please.

+++ src/platforms/mirserver/windowmanagerlistener.h
+++ src/platforms/mirserver/mirwindowmanager.h
In both files:
+ void surfaceMofidied(const std::shared_ptr<mir::scene::Surface>& surface,
Type. Plus & beside var name.

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

+ void surfaceMofidied(const std::shared_ptr<mir::scene::Surface>& surface,
typo

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> As I said in the unity-api MP, I don't understand what you mean by "shell
> chrome" and suspect there might be better terminology.
>
> Am happy to see the ExecFlags stuff going away.
>
>
> +void MirSurfaceManager::onSurfaceModified(const
> std::shared_ptr<mir::scene::Surface> & surface,
> nitpick - have the & beside the variable name.

done.

>
> In this method, I'm not convinced why mutex needed. This will be called on the
> GUI thread, since it a slot connected to via a queued connection.

I didn't add the mutex, but it's protecting the "surface to qml surface" hash in other methods, so just doing the same. Either keep, or remove all.

>
> You've a blank line after the if statement here too.
>

Done.

> +++ src/modules/Unity/Application/mirsurfacemanager.h
> + const QVariant& value);
> nitpick - & beside the var name please.
>

Done.

> +++ src/platforms/mirserver/windowmanagerlistener.h

Removed this class. Not used.

> +++ src/platforms/mirserver/mirwindowmanager.h
> In both files:
> + void surfaceMofidied(const std::shared_ptr<mir::scene::Surface>& surface,
> Type. Plus & beside var name.

Done.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

+void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
I thought this was a hint set by clients only.

review: Needs Information
Revision history for this message
Gerry Boland (gerboland) wrote :

+++ src/modules/Unity/Application/mirsurfaceitem.h
newline added, please remove.

+ if (it != m_mirSurfaceToQmlSurfaceHash.end()) {
+
+ qmlSurface = it.value();
kill the newline please

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> +void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
> I thought this was a hint set by clients only.

Which is why it's not in unity-api; but the value comes through the window manager surface modifications, so I set it from there.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> > +void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
> > I thought this was a hint set by clients only.
>
> Which is why it's not in unity-api; but the value comes through the window
> manager surface modifications, so I set it from there.

It's updating the surface's internal state, not the server->client.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

> > +void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
> > I thought this was a hint set by clients only.
>
> Which is why it's not in unity-api; but the value comes through the window
> manager surface modifications, so I set it from there.

It could be a private slot then. I only see it being called in mirsurface.cpp

Revision history for this message
Gerry Boland (gerboland) wrote :

Rest looks reasonable

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> > > +void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
> > > I thought this was a hint set by clients only.
> >
> > Which is why it's not in unity-api; but the value comes through the window
> > manager surface modifications, so I set it from there.
>
> It could be a private slot then. I only see it being called in mirsurface.cpp

Yeah, I changed it to private slot. It was previously being called from MirSurfaceManager directly, but now it's using the surface observer in the same way as the min/max size hints are coming through.

Revision history for this message
Gerry Boland (gerboland) wrote :

Cool, thanks for that

lp:~unity-team/qtmir/shell_chrome updated
449. By Michał Sawicz

Bump application API version

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Merge trunk please, I'm getting conflicts in lp:~unity-team/qtmir/kbdLayout

review: Needs Fixing
lp:~unity-team/qtmir/shell_chrome updated
450. By Lukáš Tinkl

merge trunk

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Code reasonable. I tested the same code earlier and it was good

review: Approve
lp:~unity-team/qtmir/shell_chrome updated
451. By Nick Dedekind

fixed initial low chrome value

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-02-12 00:07:20 +0000
3+++ CMakeLists.txt 2016-03-18 12:16:11 +0000
4@@ -75,7 +75,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=13)
9+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=14)
10
11 include_directories(${APPLICATION_API_INCLUDE_DIRS})
12
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2016-03-10 09:29:49 +0000
16+++ debian/changelog 2016-03-18 12:16:11 +0000
17@@ -1,3 +1,10 @@
18+qtmir (0.4.8-0ubuntu1) UNRELEASED; urgency=medium
19+
20+ [ Nick Dedekind ]
21+ * Added Application::setStage
22+
23+ -- Nick Dedekind <nick.dedekind@canonical.com> Thu, 03 Dec 2015 09:05:41 +0000
24+
25 qtmir (0.4.7+16.04.20160310.1-0ubuntu1) xenial; urgency=medium
26
27 [ Alan Griffiths ]
28
29=== modified file 'debian/control'
30--- debian/control 2016-02-03 16:40:09 +0000
31+++ debian/control 2016-03-18 12:16:11 +0000
32@@ -22,7 +22,7 @@
33 libubuntu-app-launch2-dev,
34 libubuntu-application-api-dev (>= 2.1.0),
35 libudev-dev,
36- libunity-api-dev (>= 7.106),
37+ libunity-api-dev (>= 7.108),
38 liburl-dispatcher1-dev,
39 libxkbcommon-dev,
40 libxrender-dev,
41@@ -93,7 +93,7 @@
42 Conflicts: libqtmir,
43 libunity-mir1,
44 Provides: unity-application-impl,
45- unity-application-impl-13,
46+ unity-application-impl-14,
47 Description: Qt plugin for Unity specific Mir APIs
48 QtMir provides Qt/QML bindings for Mir features that are exposed through the
49 qtmir-desktop or qtmir-android QPA plugin such as Application management
50
51=== modified file 'src/modules/Unity/Application/application.cpp'
52--- src/modules/Unity/Application/application.cpp 2016-02-12 00:07:09 +0000
53+++ src/modules/Unity/Application/application.cpp 2016-03-18 12:16:11 +0000
54@@ -46,6 +46,7 @@
55 , m_desktopData(desktopFileReader)
56 , m_pid(0)
57 , m_stage((desktopFileReader->stageHint() == "SideStage") ? Application::SideStage : Application::MainStage)
58+ , m_supportedStages(Application::MainStage|Application::SideStage)
59 , m_state(InternalState::Starting)
60 , m_focused(false)
61 , m_arguments(arguments)
62@@ -513,7 +514,7 @@
63 qCDebug(QTMIR_APPLICATIONS) << "Application::setStage - appId=" << appId() << "stage=" << stage;
64
65 if (m_stage != stage) {
66- if (stage | m_supportedStages) {
67+ if ((stage | m_supportedStages) == 0) {
68 return;
69 }
70
71
72=== modified file 'src/modules/Unity/Application/application.h'
73--- src/modules/Unity/Application/application.h 2016-02-11 11:54:59 +0000
74+++ src/modules/Unity/Application/application.h 2016-03-18 12:16:11 +0000
75@@ -52,7 +52,6 @@
76 Q_PROPERTY(QString desktopFile READ desktopFile CONSTANT)
77 Q_PROPERTY(QString exec READ exec CONSTANT)
78 Q_PROPERTY(bool fullscreen READ fullscreen NOTIFY fullscreenChanged)
79- Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged)
80 Q_PROPERTY(SessionInterface* session READ session NOTIFY sessionChanged DESIGNABLE false)
81
82 public:
83@@ -93,6 +92,7 @@
84 QString comment() const override;
85 QUrl icon() const override;
86 Stage stage() const override;
87+ void setStage(Stage stage) override;
88 State state() const override;
89 RequestedState requestedState() const override;
90 void setRequestedState(RequestedState) override;
91@@ -111,8 +111,6 @@
92 QSize initialSurfaceSize() const override;
93 void setInitialSurfaceSize(const QSize &size) override;
94
95- void setStage(Stage stage);
96-
97 ProcessState processState() const { return m_processState; }
98 void setProcessState(ProcessState value);
99
100
101=== modified file 'src/modules/Unity/Application/application_manager.cpp'
102--- src/modules/Unity/Application/application_manager.cpp 2016-02-11 11:54:59 +0000
103+++ src/modules/Unity/Application/application_manager.cpp 2016-03-18 12:16:11 +0000
104@@ -337,13 +337,7 @@
105 * @param arguments Command line arguments to pass to the application to be launched
106 * @return Pointer to Application object representing the launched process. If process already running, return nullptr
107 */
108-Application* ApplicationManager::startApplication(const QString &appId,
109- const QStringList &arguments)
110-{
111- return startApplication(appId, NoFlag, arguments);
112-}
113-
114-Application *ApplicationManager::startApplication(const QString &inputAppId, ExecFlags flags,
115+Application* ApplicationManager::startApplication(const QString &inputAppId,
116 const QStringList &arguments)
117 {
118 tracepoint(qtmir, startApplication);
119@@ -364,10 +358,10 @@
120 if (application) {
121 m_queuedStartApplications.append(inputAppId);
122 qWarning() << "ApplicationManager::startApplication - application appId=" << appId << " is closing. Queuing start";
123- connect(application, &QObject::destroyed, this, [this, application, inputAppId, flags, arguments]() {
124+ connect(application, &QObject::destroyed, this, [this, application, inputAppId, arguments]() {
125 m_queuedStartApplications.removeAll(inputAppId);
126 // start the app.
127- startApplication(inputAppId, flags, arguments);
128+ startApplication(inputAppId, arguments);
129 }, Qt::QueuedConnection); // Queued so that we finish the app removal before starting again.
130 return nullptr;
131 }
132@@ -394,11 +388,6 @@
133 return nullptr;
134 }
135
136- // override stage if necessary
137- if (application->stage() == Application::SideStage && flags.testFlag(ApplicationManager::ForceMainStage)) {
138- application->setStage(Application::MainStage);
139- }
140-
141 add(application);
142 }
143 return application;
144
145=== modified file 'src/modules/Unity/Application/application_manager.h'
146--- src/modules/Unity/Application/application_manager.h 2016-02-11 11:54:59 +0000
147+++ src/modules/Unity/Application/application_manager.h 2016-03-18 12:16:11 +0000
148@@ -54,7 +54,6 @@
149 {
150 Q_OBJECT
151 Q_ENUMS(MoreRoles)
152- Q_FLAGS(ExecFlags)
153
154 // TODO: Move to unity::shell::application::ApplicationManagerInterface
155 Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged)
156@@ -72,13 +71,6 @@
157 RoleFullscreen,
158 };
159
160- // Mapping enums to Ubuntu Platform API enums.
161- enum Flag {
162- NoFlag = 0x0,
163- ForceMainStage = 0x1,
164- };
165- Q_DECLARE_FLAGS(ExecFlags, Flag)
166-
167 static ApplicationManager* singleton();
168
169 explicit ApplicationManager(
170@@ -98,15 +90,13 @@
171 Q_INVOKABLE bool requestFocusApplication(const QString &appId) override;
172 Q_INVOKABLE bool focusApplication(const QString &appId) override;
173 Q_INVOKABLE void unfocusCurrentApplication() override;
174- Q_INVOKABLE qtmir::Application* startApplication(const QString &appId, const QStringList &arguments) override;
175+ Q_INVOKABLE qtmir::Application* startApplication(const QString &appId, const QStringList &arguments = QStringList()) override;
176 Q_INVOKABLE bool stopApplication(const QString &appId) override;
177
178 // QAbstractListModel
179 int rowCount(const QModelIndex & parent = QModelIndex()) const override;
180 QVariant data(const QModelIndex & index, int role) const override;
181
182- Q_INVOKABLE qtmir::Application *startApplication(const QString &appId, ExecFlags flags,
183- const QStringList &arguments = QStringList());
184 Q_INVOKABLE void move(int from, int to);
185
186 bool isEmpty() const { return rowCount() == 0; }
187
188=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
189--- src/modules/Unity/Application/mirsurface.cpp 2016-02-18 18:25:03 +0000
190+++ src/modules/Unity/Application/mirsurface.cpp 2016-03-18 12:16:11 +0000
191@@ -175,7 +175,7 @@
192 SessionInterface* session,
193 mir::shell::Shell* shell,
194 std::shared_ptr<SurfaceObserver> observer,
195- const SizeHints &sizeHints)
196+ const CreationHints &creationHints)
197 : MirSurfaceInterface()
198 , m_surface(surface)
199 , m_session(session)
200@@ -185,13 +185,15 @@
201 , m_textureUpdated(false)
202 , m_currentFrameNumber(0)
203 , m_live(true)
204+ , m_shellChrome(Mir::NormalChrome)
205 {
206- m_minimumWidth = sizeHints.minWidth;
207- m_minimumHeight = sizeHints.minHeight;
208- m_maximumWidth = sizeHints.maxWidth;
209- m_maximumHeight = sizeHints.maxHeight;
210- m_widthIncrement = sizeHints.widthIncrement;
211- m_heightIncrement = sizeHints.heightIncrement;
212+ m_minimumWidth = creationHints.minWidth;
213+ m_minimumHeight = creationHints.minHeight;
214+ m_maximumWidth = creationHints.maxWidth;
215+ m_maximumHeight = creationHints.maxHeight;
216+ m_widthIncrement = creationHints.widthIncrement;
217+ m_heightIncrement = creationHints.heightIncrement;
218+ m_shellChrome = creationHints.shellChrome;
219
220 m_surfaceObserver = observer;
221 if (observer) {
222@@ -205,6 +207,9 @@
223 connect(observer.get(), &SurfaceObserver::maximumHeightChanged, this, &MirSurface::setMaximumHeight);
224 connect(observer.get(), &SurfaceObserver::widthIncrementChanged, this, &MirSurface::setWidthIncrement);
225 connect(observer.get(), &SurfaceObserver::heightIncrementChanged, this, &MirSurface::setHeightIncrement);
226+ connect(observer.get(), &SurfaceObserver::shellChromeChanged, this, [&](MirShellChrome shell_chrome) {
227+ setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome));
228+ });
229 observer->setListener(this);
230 }
231
232@@ -766,6 +771,20 @@
233 return m_cursor;
234 }
235
236+Mir::ShellChrome MirSurface::shellChrome() const
237+{
238+ return m_shellChrome;
239+}
240+
241+void MirSurface::setShellChrome(Mir::ShellChrome shellChrome)
242+{
243+ if (m_shellChrome != shellChrome) {
244+ m_shellChrome = shellChrome;
245+
246+ Q_EMIT shellChromeChanged(shellChrome);
247+ }
248+}
249+
250 void MirSurface::setCursor(const QCursor &cursor)
251 {
252 DEBUG_MSG << "(" << qtCursorShapeToStr(cursor.shape()) << ")";
253
254=== modified file 'src/modules/Unity/Application/mirsurface.h'
255--- src/modules/Unity/Application/mirsurface.h 2016-02-11 11:58:16 +0000
256+++ src/modules/Unity/Application/mirsurface.h 2016-03-18 12:16:11 +0000
257@@ -32,11 +32,10 @@
258 #include "session.h"
259
260 // mirserver
261-#include "sizehints.h"
262+#include "creationhints.h"
263
264 // mir
265 #include <mir/scene/surface.h>
266-#include <mir_toolkit/common.h>
267
268 namespace mir { namespace shell { class Shell; }}
269
270@@ -53,7 +52,7 @@
271 SessionInterface* session,
272 mir::shell::Shell *shell,
273 std::shared_ptr<SurfaceObserver> observer,
274- const SizeHints &);
275+ const CreationHints &);
276 virtual ~MirSurface();
277
278 ////
279@@ -132,6 +131,8 @@
280
281 QCursor cursor() const override;
282
283+ Mir::ShellChrome shellChrome() const override;
284+
285 public Q_SLOTS:
286 void onCompositorSwappedBuffers() override;
287
288@@ -141,6 +142,7 @@
289 void setMaximumHeight(int) override;
290 void setWidthIncrement(int) override;
291 void setHeightIncrement(int) override;
292+ void setShellChrome(Mir::ShellChrome shellChrome) override;
293
294 private Q_SLOTS:
295 void dropPendingBuffer();
296@@ -183,6 +185,7 @@
297 QSize m_size;
298
299 QCursor m_cursor;
300+ Mir::ShellChrome m_shellChrome;
301
302 int m_minimumWidth{0};
303 int m_minimumHeight{0};
304
305=== modified file 'src/modules/Unity/Application/mirsurfaceinterface.h'
306--- src/modules/Unity/Application/mirsurfaceinterface.h 2016-02-11 11:58:16 +0000
307+++ src/modules/Unity/Application/mirsurfaceinterface.h 2016-03-18 12:16:11 +0000
308@@ -37,6 +37,7 @@
309 class MirSurfaceInterface : public unity::shell::application::MirSurfaceInterface
310 {
311 Q_OBJECT
312+
313 public:
314 MirSurfaceInterface(QObject *parent = nullptr) : unity::shell::application::MirSurfaceInterface(parent) {}
315 virtual ~MirSurfaceInterface() {}
316@@ -98,6 +99,7 @@
317 virtual void setMaximumHeight(int) = 0;
318 virtual void setWidthIncrement(int) = 0;
319 virtual void setHeightIncrement(int) = 0;
320+ virtual void setShellChrome(Mir::ShellChrome shellChrome) = 0;
321
322 Q_SIGNALS:
323 void firstFrameDrawn();
324
325=== modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp'
326--- src/modules/Unity/Application/mirsurfaceitem.cpp 2015-12-10 13:08:43 +0000
327+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2016-03-18 12:16:11 +0000
328@@ -179,6 +179,11 @@
329 return m_surface && m_surface->live();
330 }
331
332+Mir::ShellChrome MirSurfaceItem::shellChrome() const
333+{
334+ return m_surface ? m_surface->shellChrome() : Mir::NormalChrome;
335+}
336+
337 // Called from the rendering (scene graph) thread
338 QSGTextureProvider *MirSurfaceItem::textureProvider() const
339 {
340@@ -648,6 +653,7 @@
341 connect(m_surface, &MirSurfaceInterface::liveChanged, this, &MirSurfaceItem::liveChanged);
342 connect(m_surface, &MirSurfaceInterface::sizeChanged, this, &MirSurfaceItem::onActualSurfaceSizeChanged);
343 connect(m_surface, &MirSurfaceInterface::cursorChanged, this, &MirSurfaceItem::setCursor);
344+ connect(m_surface, &MirSurfaceInterface::shellChromeChanged, this, &MirSurfaceItem::shellChromeChanged);
345
346 Q_EMIT typeChanged(m_surface->type());
347 Q_EMIT liveChanged(true);
348
349=== modified file 'src/modules/Unity/Application/mirsurfaceitem.h'
350--- src/modules/Unity/Application/mirsurfaceitem.h 2015-12-12 13:47:43 +0000
351+++ src/modules/Unity/Application/mirsurfaceitem.h 2016-03-18 12:16:11 +0000
352@@ -49,6 +49,7 @@
353 Mir::Type type() const override;
354 QString name() const override;
355 bool live() const override;
356+ Mir::ShellChrome shellChrome() const override;
357
358 Mir::State surfaceState() const override;
359 void setSurfaceState(Mir::State) override;
360
361=== modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp'
362--- src/modules/Unity/Application/mirsurfacemanager.cpp 2016-02-16 13:34:34 +0000
363+++ src/modules/Unity/Application/mirsurfacemanager.cpp 2016-03-18 12:16:11 +0000
364@@ -34,7 +34,7 @@
365 #include "mirserver.h"
366 #include "sessionlistener.h"
367 #include "logging.h"
368-#include "sizehints.h"
369+#include "creationhints.h"
370
371 Q_LOGGING_CATEGORY(QTMIR_SURFACES, "qtmir.surfaces")
372
373@@ -99,13 +99,14 @@
374 void MirSurfaceManager::onSessionCreatedSurface(const mir::scene::Session *mirSession,
375 const std::shared_ptr<mir::scene::Surface> &surface,
376 const std::shared_ptr<SurfaceObserver> &observer,
377- qtmir::SizeHints sizeHints)
378+ qtmir::CreationHints creationHints)
379 {
380 qCDebug(QTMIR_SURFACES) << "MirSurfaceManager::onSessionCreatedSurface - mirSession=" << mirSession
381- << "surface=" << surface.get() << "surface.name=" << surface->name().c_str();
382+ << "surface=" << surface.get() << "surface.name=" << surface->name().c_str()
383+ << "creationHints=" << creationHints.toString();
384
385 SessionInterface* session = m_sessionManager->findSession(mirSession);
386- auto qmlSurface = new MirSurface(surface, session, m_shell, observer, sizeHints);
387+ auto qmlSurface = new MirSurface(surface, session, m_shell, observer, creationHints);
388 {
389 QMutexLocker lock(&m_mutex);
390 m_mirSurfaceToQmlSurfaceHash.insert(surface.get(), qmlSurface);
391@@ -149,9 +150,7 @@
392 QMutexLocker lock(&m_mutex);
393 auto it = m_mirSurfaceToQmlSurfaceHash.find(surface.get());
394 if (it != m_mirSurfaceToQmlSurfaceHash.end()) {
395-
396 qmlSurface = it.value();
397-
398 m_mirSurfaceToQmlSurfaceHash.erase(it);
399 } else {
400 qCritical() << "MirSurfaceManager::onSessionDestroyingSurface: unable to find MirSurface corresponding"
401
402=== modified file 'src/modules/Unity/Application/mirsurfacemanager.h'
403--- src/modules/Unity/Application/mirsurfacemanager.h 2016-02-16 13:34:34 +0000
404+++ src/modules/Unity/Application/mirsurfacemanager.h 2016-03-18 12:16:11 +0000
405@@ -30,7 +30,7 @@
406 #include <mir_toolkit/common.h>
407
408 // mirserver qpa
409-#include <sizehints.h>
410+#include <creationhints.h>
411
412 namespace mir {
413 namespace scene {
414@@ -77,7 +77,7 @@
415 void onSessionCreatedSurface(const mir::scene::Session *,
416 const std::shared_ptr<mir::scene::Surface> &,
417 std::shared_ptr<SurfaceObserver> const&,
418- qtmir::SizeHints);
419+ qtmir::CreationHints);
420 void onSessionDestroyingSurface(const mir::scene::Session *, const std::shared_ptr<mir::scene::Surface> &);
421
422 protected:
423
424=== modified file 'src/modules/Unity/Application/session.cpp'
425--- src/modules/Unity/Application/session.cpp 2016-01-22 16:32:39 +0000
426+++ src/modules/Unity/Application/session.cpp 2016-03-18 12:16:11 +0000
427@@ -253,13 +253,15 @@
428 Q_EMIT lastSurfaceChanged(lastSurface());
429 }
430 }
431+
432+ updateFullscreenProperty();
433 }
434
435 void Session::updateFullscreenProperty()
436 {
437 if (m_surfaces.rowCount() > 0) {
438 // TODO: Figure out something better
439- setFullscreen(m_surfaces.list().at(0)->state() == Mir::FullscreenState);
440+ setFullscreen(lastSurface()->state() == Mir::FullscreenState);
441 } else {
442 // Keep the current value of the fullscreen property until we get a new
443 // surface
444
445=== modified file 'src/platforms/mirserver/CMakeLists.txt'
446--- src/platforms/mirserver/CMakeLists.txt 2016-03-10 09:28:57 +0000
447+++ src/platforms/mirserver/CMakeLists.txt 2016-03-18 12:16:11 +0000
448@@ -71,7 +71,7 @@
449 services.cpp
450 ubuntutheme.cpp
451 clipboard.cpp
452- sizehints.cpp
453+ creationhints.cpp
454 tileddisplayconfigurationpolicy.cpp
455 tracepoints.c
456 # We need to run moc on these headers
457
458=== renamed file 'src/platforms/mirserver/sizehints.cpp' => 'src/platforms/mirserver/creationhints.cpp'
459--- src/platforms/mirserver/sizehints.cpp 2016-02-11 11:58:16 +0000
460+++ src/platforms/mirserver/creationhints.cpp 2016-03-18 12:16:11 +0000
461@@ -16,11 +16,21 @@
462
463 #include <mir/scene/surface_creation_parameters.h>
464
465-#include "sizehints.h"
466+#include "creationhints.h"
467
468 using namespace qtmir;
469
470-SizeHints::SizeHints(const mir::scene::SurfaceCreationParameters &params)
471+inline const char* shellChromeToString(Mir::ShellChrome chrome) {
472+ switch (chrome) {
473+ case Mir::ShellChrome::NormalChrome:
474+ return "normal";
475+ case Mir::ShellChrome::LowChrome:
476+ return "low";
477+ }
478+ return "unknown";
479+}
480+
481+CreationHints::CreationHints(const mir::scene::SurfaceCreationParameters &params)
482 {
483 minWidth = params.min_width.is_set() ? params.min_width.value().as_int() : 0;
484 maxWidth = params.max_width.is_set() ? params.max_width.value().as_int() : 0;
485@@ -30,15 +40,28 @@
486
487 widthIncrement = params.width_inc.is_set() ? params.width_inc.value().as_int() : 0;
488 heightIncrement = params.height_inc.is_set() ? params.height_inc.value().as_int() : 0;
489+
490+ if (params.shell_chrome.is_set()) {
491+ switch (params.shell_chrome.value()) {
492+ case mir_shell_chrome_normal:
493+ default:
494+ shellChrome = Mir::ShellChrome::NormalChrome;
495+ break;
496+ case mir_shell_chrome_low:
497+ shellChrome = Mir::ShellChrome::LowChrome;
498+ break;
499+ }
500+ }
501 }
502
503-QString SizeHints::toString() const
504+QString CreationHints::toString() const
505 {
506- return QString("SizeHints(minW=%1,minH=%2,maxW=%3,maxH=%4,wIncr=%5,hInc=%6)")
507+ return QString("CreationHints(minW=%1,minH=%2,maxW=%3,maxH=%4,wIncr=%5,hInc=%6,shellChrome=%7)")
508 .arg(minWidth)
509 .arg(minHeight)
510 .arg(maxWidth)
511 .arg(maxHeight)
512 .arg(widthIncrement)
513- .arg(heightIncrement);
514+ .arg(heightIncrement)
515+ .arg(shellChromeToString(shellChrome));
516 }
517
518=== renamed file 'src/platforms/mirserver/sizehints.h' => 'src/platforms/mirserver/creationhints.h'
519--- src/platforms/mirserver/sizehints.h 2016-02-11 11:58:16 +0000
520+++ src/platforms/mirserver/creationhints.h 2016-03-18 12:16:11 +0000
521@@ -14,12 +14,14 @@
522 * along with this program. If not, see <http://www.gnu.org/licenses/>.
523 */
524
525-#ifndef QTMIR_SIZEHINTS_H
526-#define QTMIR_SIZEHINTS_H
527+#ifndef QTMIR_CREATIONHINTS_H
528+#define QTMIR_CREATIONHINTS_H
529
530 #include <QMetaType>
531 #include <QString>
532
533+#include <unity/shell/application/Mir.h>
534+
535 namespace mir {
536 namespace scene {
537 class SurfaceCreationParameters;
538@@ -28,10 +30,10 @@
539
540 namespace qtmir {
541
542-class SizeHints {
543+class CreationHints {
544 public:
545- SizeHints() {}
546- SizeHints(const mir::scene::SurfaceCreationParameters&);
547+ CreationHints() {}
548+ CreationHints(const mir::scene::SurfaceCreationParameters&);
549
550 QString toString() const;
551
552@@ -43,10 +45,12 @@
553
554 int widthIncrement{0};
555 int heightIncrement{0};
556+
557+ Mir::ShellChrome shellChrome{Mir::ShellChrome::NormalChrome};
558 };
559
560 } // namespace qtmir
561
562-Q_DECLARE_METATYPE(qtmir::SizeHints)
563+Q_DECLARE_METATYPE(qtmir::CreationHints)
564
565-#endif // QTMIR_SIZEHINTS_H
566+#endif // QTMIR_CREATIONHINTS_H
567
568=== modified file 'src/platforms/mirserver/mirwindowmanager.cpp'
569--- src/platforms/mirserver/mirwindowmanager.cpp 2016-02-11 11:58:16 +0000
570+++ src/platforms/mirserver/mirwindowmanager.cpp 2016-03-18 12:16:11 +0000
571@@ -107,7 +107,7 @@
572 {
573 tracepoint(qtmirserver, surfacePlacementStart);
574
575- m_sessionListener->surfaceAboutToBeCreated(*session.get(), qtmir::SizeHints(requestParameters));
576+ m_sessionListener->surfaceAboutToBeCreated(*session.get(), qtmir::CreationHints(requestParameters));
577
578 QSize initialSize;
579 // can be connected to via Qt::BlockingQueuedConnection to alter surface initial size
580@@ -136,7 +136,10 @@
581
582 tracepoint(qtmirserver, surfacePlacementEnd);
583
584- return build(session, placedParameters);
585+ auto const result = build(session, placedParameters);
586+ auto const surface = session->surface(result);
587+
588+ return result;
589 }
590
591 void MirWindowManagerImpl::remove_surface(
592@@ -188,14 +191,10 @@
593 const std::shared_ptr<mir::scene::Surface>& surface,
594 const mir::shell::SurfaceSpecification& modifications)
595 {
596- if (modifications.name.is_set()) {
597- surface->rename(modifications.name.value());
598- }
599-
600 QMutexLocker(&SurfaceObserver::mutex);
601 SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get());
602 if (observer) {
603- observer->notifySizeHintChanges(modifications);
604+ observer->notifySurfaceModifications(modifications);
605 }
606 }
607
608
609=== modified file 'src/platforms/mirserver/sessionlistener.cpp'
610--- src/platforms/mirserver/sessionlistener.cpp 2016-02-11 11:58:16 +0000
611+++ src/platforms/mirserver/sessionlistener.cpp 2016-03-18 12:16:11 +0000
612@@ -34,7 +34,7 @@
613 qRegisterMetaType<std::shared_ptr<ms::Session>>("std::shared_ptr<mir::scene::Session>");
614 qRegisterMetaType<std::shared_ptr<ms::Surface>>("std::shared_ptr<mir::scene::Surface>");
615 qRegisterMetaType<std::shared_ptr<SurfaceObserver>>("std::shared_ptr<SurfaceObserver>");
616- qRegisterMetaType<qtmir::SizeHints>();
617+ qRegisterMetaType<qtmir::CreationHints>();
618 }
619
620 SessionListener::~SessionListener()
621@@ -77,9 +77,9 @@
622 SurfaceObserver::registerObserverForSurface(surfaceObserver.get(), surface.get());
623 surface->add_observer(surfaceObserver);
624
625- qtmir::SizeHints sizeHints = m_sizeHintsForNewSurface.take(&session);
626+ qtmir::CreationHints creationHints = m_creationHintsForNewSurface.take(&session);
627
628- Q_EMIT sessionCreatedSurface(&session, surface, surfaceObserver, sizeHints);
629+ Q_EMIT sessionCreatedSurface(&session, surface, surfaceObserver, creationHints);
630 }
631
632 void SessionListener::destroying_surface(ms::Session& session, std::shared_ptr<ms::Surface> const& surface)
633@@ -90,7 +90,7 @@
634 Q_EMIT sessionDestroyingSurface(&session, surface);
635 }
636
637-void SessionListener::surfaceAboutToBeCreated(mir::scene::Session& session, qtmir::SizeHints sizeHints)
638+void SessionListener::surfaceAboutToBeCreated(mir::scene::Session& session, qtmir::CreationHints creationHints)
639 {
640- m_sizeHintsForNewSurface[&session] = sizeHints;
641+ m_creationHintsForNewSurface[&session] = creationHints;
642 }
643
644=== modified file 'src/platforms/mirserver/sessionlistener.h'
645--- src/platforms/mirserver/sessionlistener.h 2016-02-11 11:58:16 +0000
646+++ src/platforms/mirserver/sessionlistener.h 2016-03-18 12:16:11 +0000
647@@ -23,7 +23,7 @@
648 #include "mir/scene/session_listener.h"
649 #include "mir/scene/session.h"
650
651-#include "sizehints.h"
652+#include "creationhints.h"
653
654 class SurfaceObserver;
655
656@@ -42,7 +42,7 @@
657 void surface_created(mir::scene::Session&, std::shared_ptr<mir::scene::Surface> const&) override;
658 void destroying_surface(mir::scene::Session&, std::shared_ptr<mir::scene::Surface> const&) override;
659
660- void surfaceAboutToBeCreated(mir::scene::Session&, qtmir::SizeHints sizeHints);
661+ void surfaceAboutToBeCreated(mir::scene::Session&, qtmir::CreationHints creationHints);
662
663 Q_SIGNALS:
664 void sessionStarting(std::shared_ptr<mir::scene::Session> const& session);
665@@ -53,11 +53,11 @@
666 void sessionCreatedSurface(mir::scene::Session const*,
667 std::shared_ptr<mir::scene::Surface> const&,
668 std::shared_ptr<SurfaceObserver> const&,
669- qtmir::SizeHints);
670+ qtmir::CreationHints);
671 void sessionDestroyingSurface(mir::scene::Session const*, std::shared_ptr<mir::scene::Surface> const&);
672
673 private:
674- QMap<mir::scene::Session*, qtmir::SizeHints> m_sizeHintsForNewSurface;
675+ QMap<mir::scene::Session*, qtmir::CreationHints> m_creationHintsForNewSurface;
676 };
677
678 #endif // SESSIONLISTENER_H
679
680=== modified file 'src/platforms/mirserver/surfaceobserver.cpp'
681--- src/platforms/mirserver/surfaceobserver.cpp 2016-02-11 11:58:16 +0000
682+++ src/platforms/mirserver/surfaceobserver.cpp 2016-03-18 12:16:11 +0000
683@@ -56,6 +56,8 @@
684 m_cursorNameToShape["dnd-copy"] = Qt::DragCopyCursor;
685 m_cursorNameToShape["dnd-move"] = Qt::DragMoveCursor;
686 m_cursorNameToShape["dnd-link"] = Qt::DragLinkCursor;
687+
688+ qRegisterMetaType<MirShellChrome>("MirShellChrome");
689 }
690
691 SurfaceObserver::~SurfaceObserver()
692@@ -107,10 +109,9 @@
693 void SurfaceObserver::resized_to(mir::geometry::Size const&size)
694 {
695 Q_EMIT resized(QSize(size.width.as_int(), size.height.as_int()));
696-
697 }
698
699-void SurfaceObserver::notifySizeHintChanges(const mir::shell::SurfaceSpecification &modifications)
700+void SurfaceObserver::notifySurfaceModifications(const mir::shell::SurfaceSpecification &modifications)
701 {
702 if (modifications.min_width.is_set()) {
703 Q_EMIT minimumWidthChanged(modifications.min_width.value().as_int());
704@@ -130,6 +131,9 @@
705 if (modifications.height_inc.is_set()) {
706 Q_EMIT heightIncrementChanged(modifications.height_inc.value().as_int());
707 }
708+ if (modifications.shell_chrome.is_set()) {
709+ Q_EMIT shellChromeChanged(modifications.shell_chrome.value());
710+ }
711 }
712
713 SurfaceObserver *SurfaceObserver::observerForSurface(const mir::scene::Surface *surface)
714
715=== modified file 'src/platforms/mirserver/surfaceobserver.h'
716--- src/platforms/mirserver/surfaceobserver.h 2016-02-11 11:58:16 +0000
717+++ src/platforms/mirserver/surfaceobserver.h 2016-03-18 12:16:11 +0000
718@@ -63,7 +63,7 @@
719 void renamed(char const * name) override;
720 void cursor_image_removed() override;
721
722- void notifySizeHintChanges(const mir::shell::SurfaceSpecification&);
723+ void notifySurfaceModifications(const mir::shell::SurfaceSpecification&);
724
725 static SurfaceObserver *observerForSurface(const mir::scene::Surface *surface);
726 static void registerObserverForSurface(SurfaceObserver *observer, const mir::scene::Surface *surface);
727@@ -82,6 +82,7 @@
728 void maximumHeightChanged(int);
729 void widthIncrementChanged(int);
730 void heightIncrementChanged(int);
731+ void shellChromeChanged(MirShellChrome);
732
733 private:
734 QCursor createQCursorFromMirCursorImage(const mir::graphics::CursorImage &cursorImage);
735
736=== modified file 'tests/framework/fake_mirsurface.h'
737--- tests/framework/fake_mirsurface.h 2016-02-15 17:18:08 +0000
738+++ tests/framework/fake_mirsurface.h 2016-03-18 12:16:11 +0000
739@@ -110,6 +110,9 @@
740
741 QCursor cursor() const override { return QCursor(); }
742
743+ Mir::ShellChrome shellChrome() const override { return Mir::NormalChrome; }
744+ void setShellChrome(Mir::ShellChrome) override {}
745+
746 void close() override {
747 Q_EMIT closeRequested();
748 }
749
750=== modified file 'tests/framework/qtmir_test.cpp'
751--- tests/framework/qtmir_test.cpp 2016-02-15 17:28:44 +0000
752+++ tests/framework/qtmir_test.cpp 2016-03-18 12:16:11 +0000
753@@ -155,7 +155,7 @@
754 .Times(1)
755 .WillOnce(Return(true));
756
757- auto application = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
758+ auto application = applicationManager.startApplication(appId);
759 applicationManager.onProcessStarting(appId);
760
761 bool authed = false;
762
763=== modified file 'tests/mirserver/WindowManager/CMakeLists.txt'
764--- tests/mirserver/WindowManager/CMakeLists.txt 2015-10-12 16:28:48 +0000
765+++ tests/mirserver/WindowManager/CMakeLists.txt 2016-03-18 12:16:11 +0000
766@@ -12,6 +12,8 @@
767 target_link_libraries(
768 WindowManagerTest
769
770+ Qt5::Test
771+
772 qpa-mirserver
773
774 ${GTEST_BOTH_LIBRARIES}
775
776=== modified file 'tests/mirserver/WindowManager/window_manager.cpp'
777--- tests/mirserver/WindowManager/window_manager.cpp 2016-02-11 11:58:16 +0000
778+++ tests/mirserver/WindowManager/window_manager.cpp 2016-03-18 12:16:11 +0000
779@@ -15,9 +15,12 @@
780 *
781 */
782
783+#include <QSignalSpy>
784+
785 #include "mirwindowmanager.h"
786 #include "stub_surface.h"
787 #include "stub_session.h"
788+#include "surfaceobserver.h"
789
790 #include <mir/events/event_builders.h>
791 #include <mir/scene/surface_creation_parameters.h>
792@@ -218,11 +221,29 @@
793 {
794 add_surface();
795
796- msh::SurfaceSpecification spec;
797-
798- EXPECT_NO_THROW(
799- window_manager->modify_surface(arbitrary_session, arbitrary_surface, spec);
800- );
801+ SurfaceObserver surfaceObserver;
802+ SurfaceObserver::registerObserverForSurface(&surfaceObserver, arbitrary_surface.get());
803+
804+ mir::shell::SurfaceSpecification modifications;
805+ modifications.min_width = mir::geometry::Width(100);
806+ modifications.min_height = mir::geometry::Height(101);
807+ modifications.max_width = mir::geometry::Width(102);
808+ modifications.max_height = mir::geometry::Height(103);
809+ modifications.shell_chrome = mir_shell_chrome_low;
810+
811+ QSignalSpy spyMinimumWidthChanged(&surfaceObserver, SIGNAL(minimumWidthChanged(int)));
812+ QSignalSpy spyMinimumHeightChanged(&surfaceObserver, SIGNAL(minimumHeightChanged(int)));
813+ QSignalSpy spyMaximumWidthChanged(&surfaceObserver, SIGNAL(maximumWidthChanged(int)));
814+ QSignalSpy spyMaximumHeightChanged(&surfaceObserver, SIGNAL(maximumHeightChanged(int)));
815+ QSignalSpy spyShellChromeChanged(&surfaceObserver, SIGNAL(shellChromeChanged(MirShellChrome)));
816+
817+ window_manager->modify_surface(arbitrary_session, arbitrary_surface, modifications);
818+
819+ EXPECT_EQ(100, spyMinimumWidthChanged.takeFirst().at(0).toInt());
820+ EXPECT_EQ(101, spyMinimumHeightChanged.takeFirst().at(0).toInt());
821+ EXPECT_EQ(102, spyMaximumWidthChanged.takeFirst().at(0).toInt());
822+ EXPECT_EQ(103, spyMaximumHeightChanged.takeFirst().at(0).toInt());
823+ EXPECT_EQ(mir_shell_chrome_low, spyShellChromeChanged.takeFirst().at(0).toInt());
824
825 window_manager->remove_surface(arbitrary_session, arbitrary_surface);
826 }
827
828=== modified file 'tests/modules/ApplicationManager/application_manager_test.cpp'
829--- tests/modules/ApplicationManager/application_manager_test.cpp 2016-02-22 22:26:30 +0000
830+++ tests/modules/ApplicationManager/application_manager_test.cpp 2016-03-18 12:16:11 +0000
831@@ -165,7 +165,6 @@
832
833 auto application = applicationManager.startApplication(
834 shortAppId,
835- ApplicationManager::NoFlag,
836 QStringList());
837
838 EXPECT_EQ(shortAppId, application->appId());
839@@ -185,7 +184,6 @@
840
841 auto application = applicationManager.startApplication(
842 longAppId,
843- ApplicationManager::NoFlag,
844 QStringList());
845
846 EXPECT_EQ(shortAppId, application->appId());
847@@ -495,7 +493,7 @@
848 QSignalSpy addedSpy(&applicationManager, SIGNAL(applicationAdded(const QString &)));
849
850 // start the application
851- Application *theApp = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
852+ Application *theApp = applicationManager.startApplication(appId);
853
854 // check application data
855 EXPECT_EQ(Application::Starting, theApp->state());
856@@ -694,7 +692,7 @@
857 ));
858
859 // start the application
860- Application *theApp = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
861+ Application *theApp = applicationManager.startApplication(appId);
862
863 // check application data
864 EXPECT_EQ(theApp->state(), Application::Starting);
865@@ -764,7 +762,7 @@
866 .Times(1)
867 .WillOnce(Return(true));
868
869- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
870+ applicationManager.startApplication(appId);
871
872 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
873 QSignalSpy addedSpy(&applicationManager, SIGNAL(applicationAdded(const QString &)));
874@@ -799,7 +797,7 @@
875 .Times(1)
876 .WillOnce(Return(true));
877
878- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
879+ applicationManager.startApplication(appId);
880 applicationManager.onProcessStarting(appId);
881
882 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
883@@ -840,7 +838,7 @@
884 .Times(1)
885 .WillOnce(Return(true));
886
887- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
888+ applicationManager.startApplication(appId);
889 applicationManager.onProcessStarting(appId);
890
891 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
892@@ -876,7 +874,7 @@
893 .Times(1)
894 .WillOnce(Return(true));
895
896- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
897+ applicationManager.startApplication(appId);
898 applicationManager.onProcessStarting(appId);
899 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
900 bool authed = true;
901@@ -916,7 +914,7 @@
902 .Times(1)
903 .WillOnce(Return(true));
904
905- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
906+ applicationManager.startApplication(appId);
907 applicationManager.onProcessStarting(appId);
908 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
909 bool authed = true;
910@@ -956,7 +954,7 @@
911 .Times(1)
912 .WillOnce(Return(true));
913
914- Application *application = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
915+ Application *application = applicationManager.startApplication(appId);
916 applicationManager.onProcessStarting(appId);
917 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
918 bool authed = true;
919@@ -999,7 +997,7 @@
920 .Times(1)
921 .WillOnce(Return(true));
922
923- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
924+ applicationManager.startApplication(appId);
925 applicationManager.onProcessStarting(appId);
926 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
927 bool authed = true;
928@@ -1041,7 +1039,7 @@
929 .Times(1)
930 .WillOnce(Return(true));
931
932- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
933+ applicationManager.startApplication(appId);
934 applicationManager.onProcessStarting(appId);
935 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
936 bool authed = true;
937@@ -1089,7 +1087,7 @@
938 .Times(1)
939 .WillOnce(Return(true));
940
941- Application *app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
942+ Application *app = applicationManager.startApplication(appId);
943 applicationManager.onProcessStarting(appId);
944 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
945 bool authed = true;
946@@ -1144,7 +1142,7 @@
947 .Times(1)
948 .WillOnce(Return(true));
949
950- Application *app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
951+ Application *app = applicationManager.startApplication(appId);
952 applicationManager.onProcessStarting(appId);
953 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
954 bool authed = true;
955@@ -1194,7 +1192,7 @@
956 .Times(1)
957 .WillOnce(Return(true));
958
959- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
960+ applicationManager.startApplication(appId);
961 applicationManager.onProcessStarting(appId);
962 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
963 bool authed = true;
964@@ -1230,7 +1228,7 @@
965 .Times(1)
966 .WillOnce(Return(true));
967
968- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
969+ applicationManager.startApplication(appId);
970 applicationManager.onProcessStarting(appId);
971 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
972 bool authed = true;
973@@ -1323,7 +1321,7 @@
974 .Times(1)
975 .WillOnce(Return(true));
976
977- Application *app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
978+ Application *app = applicationManager.startApplication(appId);
979 applicationManager.onProcessStarting(appId);
980 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
981 bool authed = true;
982@@ -1379,7 +1377,7 @@
983 .Times(1)
984 .WillOnce(Return(true));
985
986- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
987+ applicationManager.startApplication(appId);
988 applicationManager.onProcessStarting(appId);
989 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
990 bool authed = true;
991@@ -1432,7 +1430,7 @@
992 .Times(1)
993 .WillOnce(Return(true));
994
995- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
996+ applicationManager.startApplication(appId);
997 applicationManager.onProcessStarting(appId);
998 std::shared_ptr<mir::scene::Session> session1 = std::make_shared<MockSession>("", procId1);
999 std::shared_ptr<mir::scene::Session> session2 = std::make_shared<MockSession>("", procId2);
1000@@ -1488,7 +1486,7 @@
1001 .Times(1)
1002 .WillOnce(Return(true));
1003
1004- Application *app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1005+ Application *app = applicationManager.startApplication(appId);
1006 applicationManager.onProcessStarting(appId);
1007 std::shared_ptr<mir::scene::Session> session1 = std::make_shared<MockSession>("", procId1);
1008 std::shared_ptr<mir::scene::Session> session2 = std::make_shared<MockSession>("", procId2);
1009@@ -1543,7 +1541,7 @@
1010 .Times(1)
1011 .WillOnce(Return(true));
1012
1013- Application *app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1014+ Application *app = applicationManager.startApplication(appId);
1015 applicationManager.onProcessStarting(appId);
1016 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1017 bool authed = true;
1018@@ -1592,7 +1590,7 @@
1019 .Times(1)
1020 .WillOnce(Return(true));
1021
1022- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1023+ applicationManager.startApplication(appId);
1024 applicationManager.onProcessStarting(appId);
1025 auto session = std::make_shared<MockSession>("", procId);
1026 bool authed = true;
1027@@ -1705,7 +1703,7 @@
1028 .Times(1)
1029 .WillOnce(Return(true));
1030
1031- auto the_app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1032+ auto the_app = applicationManager.startApplication(appId);
1033 applicationManager.onProcessStarting(appId);
1034 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1035 bool authed = true;
1036@@ -1770,7 +1768,7 @@
1037 .Times(1)
1038 .WillOnce(Return(true));
1039
1040- auto application = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1041+ auto application = applicationManager.startApplication(appId);
1042 applicationManager.onProcessStarting(appId);
1043 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1044 bool authed = true;
1045@@ -1809,7 +1807,7 @@
1046 .Times(1)
1047 .WillOnce(Return(true));
1048
1049- applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1050+ applicationManager.startApplication(appId);
1051 applicationManager.onProcessStarting(appId);
1052 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1053 bool authed = true;
1054@@ -1850,7 +1848,7 @@
1055 .Times(1)
1056 .WillOnce(Return(true));
1057
1058- Application *the_app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1059+ Application *the_app = applicationManager.startApplication(appId);
1060 applicationManager.onProcessStarting(appId);
1061 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1062 bool authed = true;
1063@@ -1896,7 +1894,7 @@
1064 .Times(1)
1065 .WillOnce(Return(true));
1066
1067- Application *the_app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1068+ Application *the_app = applicationManager.startApplication(appId);
1069 applicationManager.onProcessStarting(appId);
1070 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1071 bool authed = true;
1072@@ -1968,7 +1966,7 @@
1073 .Times(1)
1074 .WillOnce(Return(true));
1075
1076- auto app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1077+ auto app = applicationManager.startApplication(appId);
1078 applicationManager.onProcessStarting(appId);
1079 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1080 bool authed = true;
1081@@ -2017,7 +2015,7 @@
1082 .Times(1)
1083 .WillOnce(Return(true));
1084
1085- auto app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1086+ auto app = applicationManager.startApplication(appId);
1087 applicationManager.onProcessStarting(appId);
1088 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1089 bool authed = true;
1090@@ -2049,7 +2047,7 @@
1091
1092 // Trying to start a new instance of this app while we are still waiting for its current
1093 // instance to end yields no immediate result. This command gets queued instead.
1094- EXPECT_EQ(nullptr, applicationManager.startApplication(appId, ApplicationManager::NoFlag));
1095+ EXPECT_EQ(nullptr, applicationManager.startApplication(appId));
1096
1097 QSignalSpy appAddedSpy(&applicationManager, SIGNAL(applicationAdded(const QString&)));
1098
1099@@ -2114,7 +2112,7 @@
1100 [](const QString &appId, const QFileInfo&) { return new FakeDesktopFileReader(appId); }
1101 ));
1102
1103- auto app = applicationManager.startApplication(appId, ApplicationManager::NoFlag);
1104+ auto app = applicationManager.startApplication(appId);
1105 applicationManager.onProcessStarting(appId);
1106 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
1107 bool authed = true;
1108
1109=== modified file 'tests/modules/SurfaceManager/mirsurface_test.cpp'
1110--- tests/modules/SurfaceManager/mirsurface_test.cpp 2016-02-11 11:58:16 +0000
1111+++ tests/modules/SurfaceManager/mirsurface_test.cpp 2016-03-18 12:16:11 +0000
1112@@ -31,7 +31,7 @@
1113 #include <surfaceobserver.h>
1114
1115 // mirserver
1116-#include <sizehints.h>
1117+#include <creationhints.h>
1118
1119 using namespace qtmir;
1120
1121@@ -62,7 +62,7 @@
1122 EXPECT_CALL(*mockSurface.get(),buffers_ready_for_compositor(_))
1123 .WillRepeatedly(Return(1));
1124
1125- MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, surfaceObserver, SizeHints());
1126+ MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, surfaceObserver, CreationHints());
1127 surfaceObserver->frame_posted(1, mir::geometry::Size{1,1});
1128
1129 QSignalSpy spyFrameDropped(surface, SIGNAL(frameDropped()));
1130@@ -85,7 +85,7 @@
1131 auto fakeSession = new FakeSession();
1132 auto mockSurface = std::make_shared<NiceMock<ms::MockSurface>>();
1133
1134- MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, nullptr, SizeHints());
1135+ MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, nullptr, CreationHints());
1136 bool surfaceDeleted = false;
1137 QObject::connect(surface, &QObject::destroyed, surface, [&surfaceDeleted](){ surfaceDeleted = true; });
1138
1139@@ -118,7 +118,7 @@
1140 auto fakeSession = new FakeSession();
1141 auto mockSurface = std::make_shared<NiceMock<ms::MockSurface>>();
1142
1143- MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, nullptr, SizeHints());
1144+ MirSurface *surface = new MirSurface(mockSurface, fakeSession, nullptr, nullptr, CreationHints());
1145 bool surfaceDeleted = false;
1146 QObject::connect(surface, &QObject::destroyed, surface, [&surfaceDeleted](){ surfaceDeleted = true; });
1147

Subscribers

People subscribed via source and target branches