Merge lp:~alan-griffiths/unity-mir/dont-use-OrganisingSurfaceFactory into lp:unity-mir
- dont-use-OrganisingSurfaceFactory
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gerry Boland |
Approved revision: | 141 |
Merged at revision: | 140 |
Proposed branch: | lp:~alan-griffiths/unity-mir/dont-use-OrganisingSurfaceFactory |
Merge into: | lp:unity-mir |
Diff against target: |
253 lines (+32/-42) 7 files modified
src/modules/Unity/Application/inputarea.cpp (+1/-1) src/modules/Unity/Application/mirsurfacemanager.cpp (+2/-2) src/unity-mir/shellserverconfiguration.cpp (+9/-15) src/unity-mir/shellserverconfiguration.h (+4/-4) src/unity-mir/surfacefactory.cpp (+8/-10) src/unity-mir/surfacefactory.h (+5/-7) src/unity-mir/unity-mir.pro (+3/-3) |
To merge this branch: | bzr merge lp:~alan-griffiths/unity-mir/dont-use-OrganisingSurfaceFactory |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gerry Boland (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Alexandros Frantzis (community) | Approve | ||
Review via email:
|
Commit message
Remove dependency on msh::Organising
Description of the change
Remove dependency on msh::Organising
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
Approved, thank you
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
Hang on, changed my mind about something.
+SurfaceSource:
In Mir, mir::shell:
With this MR, Unity-mir now implements mir::surface:
I'd prefer you rename the class SurfaceSource to SurfaceFactory here. Also I find the purpose of a class named "Factory" much more obvious than "Source" anyway, so I think it would be a readability win.
That does break the parallelism of naming with Mir however.
- 139. By Alan Griffiths
-
Rename SurfaceSource to SurfaceFactory
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:139
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 140. By Alan Griffiths
-
Rename SurfaceSource to SurfaceFactory
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:140
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
Text conflict in src/unity-
Text conflict in src/unity-
- 141. By Alan Griffiths
-
merge lp:unity-mir
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:141
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
Works great, thank you
Preview Diff
1 | === modified file 'src/modules/Unity/Application/inputarea.cpp' | |||
2 | --- src/modules/Unity/Application/inputarea.cpp 2013-10-18 09:25:20 +0000 | |||
3 | +++ src/modules/Unity/Application/inputarea.cpp 2013-10-30 17:46:58 +0000 | |||
4 | @@ -28,7 +28,7 @@ | |||
5 | 28 | // unity-mir | 28 | // unity-mir |
6 | 29 | #include "qmirserverapplication.h" | 29 | #include "qmirserverapplication.h" |
7 | 30 | #include "shellserverconfiguration.h" | 30 | #include "shellserverconfiguration.h" |
9 | 31 | #include "surfacesource.h" | 31 | #include "surfacefactory.h" |
10 | 32 | #include "logging.h" | 32 | #include "logging.h" |
11 | 33 | 33 | ||
12 | 34 | InputArea::InputArea(QQuickItem *parent) | 34 | InputArea::InputArea(QQuickItem *parent) |
13 | 35 | 35 | ||
14 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp' | |||
15 | --- src/modules/Unity/Application/mirsurfacemanager.cpp 2013-10-18 09:25:20 +0000 | |||
16 | +++ src/modules/Unity/Application/mirsurfacemanager.cpp 2013-10-30 17:46:58 +0000 | |||
17 | @@ -27,7 +27,7 @@ | |||
18 | 27 | #include "shellserverconfiguration.h" | 27 | #include "shellserverconfiguration.h" |
19 | 28 | #include "sessionlistener.h" | 28 | #include "sessionlistener.h" |
20 | 29 | #include "surfaceconfigurator.h" | 29 | #include "surfaceconfigurator.h" |
22 | 30 | #include "surfacesource.h" | 30 | #include "surfacefactory.h" |
23 | 31 | #include "focussetter.h" | 31 | #include "focussetter.h" |
24 | 32 | #include "logging.h" | 32 | #include "logging.h" |
25 | 33 | 33 | ||
26 | @@ -57,7 +57,7 @@ | |||
27 | 57 | } | 57 | } |
28 | 58 | m_mirServer = mirServerApplication->server(); | 58 | m_mirServer = mirServerApplication->server(); |
29 | 59 | 59 | ||
31 | 60 | QObject::connect(m_mirServer->surfaceSource(), &SurfaceSource::shellSurfaceCreated, | 60 | QObject::connect(m_mirServer->surfaceFactory(), &SurfaceFactory::shellSurfaceCreated, |
32 | 61 | this, &MirSurfaceManager::shellSurfaceCreated); | 61 | this, &MirSurfaceManager::shellSurfaceCreated); |
33 | 62 | 62 | ||
34 | 63 | QObject::connect(m_mirServer->sessionListener(), &SessionListener::sessionCreatedSurface, | 63 | QObject::connect(m_mirServer->sessionListener(), &SessionListener::sessionCreatedSurface, |
35 | 64 | 64 | ||
36 | === modified file 'src/unity-mir/shellserverconfiguration.cpp' | |||
37 | --- src/unity-mir/shellserverconfiguration.cpp 2013-10-30 17:32:31 +0000 | |||
38 | +++ src/unity-mir/shellserverconfiguration.cpp 2013-10-30 17:46:58 +0000 | |||
39 | @@ -19,15 +19,12 @@ | |||
40 | 19 | #include "initialsurfaceplacementstrategy.h" | 19 | #include "initialsurfaceplacementstrategy.h" |
41 | 20 | #include "sessionlistener.h" | 20 | #include "sessionlistener.h" |
42 | 21 | #include "surfaceconfigurator.h" | 21 | #include "surfaceconfigurator.h" |
44 | 22 | #include "surfacesource.h" | 22 | #include "surfacefactory.h" |
45 | 23 | #include "sessionauthorizer.h" | 23 | #include "sessionauthorizer.h" |
46 | 24 | #include "surfacebuilder.h" | 24 | #include "surfacebuilder.h" |
47 | 25 | #include "focussetter.h" | 25 | #include "focussetter.h" |
48 | 26 | #include "logging.h" | 26 | #include "logging.h" |
49 | 27 | 27 | ||
50 | 28 | // mir | ||
51 | 29 | #include "mir/shell/organising_surface_factory.h" | ||
52 | 30 | |||
53 | 31 | namespace msh = mir::shell; | 28 | namespace msh = mir::shell; |
54 | 32 | namespace ms = mir::surfaces; | 29 | namespace ms = mir::surfaces; |
55 | 33 | 30 | ||
56 | @@ -96,16 +93,13 @@ | |||
57 | 96 | std::shared_ptr<msh::SurfaceFactory> | 93 | std::shared_ptr<msh::SurfaceFactory> |
58 | 97 | ShellServerConfiguration::the_shell_surface_factory() | 94 | ShellServerConfiguration::the_shell_surface_factory() |
59 | 98 | { | 95 | { |
65 | 99 | return shell_surface_factory( | 96 | if (!m_surfaceFactory) |
66 | 100 | [this]() | 97 | { |
67 | 101 | { | 98 | m_surfaceFactory = std::make_shared<SurfaceFactory>( |
68 | 102 | m_surfaceSource = std::make_shared<SurfaceSource>( | 99 | DefaultServerConfiguration::the_shell_surface_factory()); |
69 | 103 | the_surface_builder(), the_shell_surface_configurator()); | 100 | } |
70 | 104 | 101 | ||
75 | 105 | return std::make_shared<msh::OrganisingSurfaceFactory>( | 102 | return m_surfaceFactory; |
72 | 106 | m_surfaceSource, | ||
73 | 107 | the_shell_placement_strategy()); | ||
74 | 108 | }); | ||
76 | 109 | } | 103 | } |
77 | 110 | 104 | ||
78 | 111 | std::shared_ptr<msh::FocusSetter> | 105 | std::shared_ptr<msh::FocusSetter> |
79 | @@ -156,9 +150,9 @@ | |||
80 | 156 | return static_cast<SurfaceConfigurator*>(sharedPtr.get()); | 150 | return static_cast<SurfaceConfigurator*>(sharedPtr.get()); |
81 | 157 | } | 151 | } |
82 | 158 | 152 | ||
84 | 159 | SurfaceSource *ShellServerConfiguration::surfaceSource() | 153 | SurfaceFactory *ShellServerConfiguration::surfaceFactory() |
85 | 160 | { | 154 | { |
87 | 161 | return m_surfaceSource.get(); | 155 | return m_surfaceFactory.get(); |
88 | 162 | } | 156 | } |
89 | 163 | 157 | ||
90 | 164 | FocusSetter *ShellServerConfiguration::focusSetter() | 158 | FocusSetter *ShellServerConfiguration::focusSetter() |
91 | 165 | 159 | ||
92 | === modified file 'src/unity-mir/shellserverconfiguration.h' | |||
93 | --- src/unity-mir/shellserverconfiguration.h 2013-10-30 16:19:59 +0000 | |||
94 | +++ src/unity-mir/shellserverconfiguration.h 2013-10-30 17:46:58 +0000 | |||
95 | @@ -24,7 +24,7 @@ | |||
96 | 24 | class FocusSetter; | 24 | class FocusSetter; |
97 | 25 | class SessionListener; | 25 | class SessionListener; |
98 | 26 | class SessionAuthorizer; | 26 | class SessionAuthorizer; |
100 | 27 | class SurfaceSource; | 27 | class SurfaceFactory; |
101 | 28 | class SurfaceConfigurator; | 28 | class SurfaceConfigurator; |
102 | 29 | 29 | ||
103 | 30 | class ShellServerConfiguration : public QObject, public mir::DefaultServerConfiguration | 30 | class ShellServerConfiguration : public QObject, public mir::DefaultServerConfiguration |
104 | @@ -34,7 +34,7 @@ | |||
105 | 34 | Q_PROPERTY(SessionAuthorizer* sessionAuthorizer READ sessionAuthorizer CONSTANT) | 34 | Q_PROPERTY(SessionAuthorizer* sessionAuthorizer READ sessionAuthorizer CONSTANT) |
106 | 35 | Q_PROPERTY(SessionListener* sessionListener READ sessionListener CONSTANT) | 35 | Q_PROPERTY(SessionListener* sessionListener READ sessionListener CONSTANT) |
107 | 36 | Q_PROPERTY(SurfaceConfigurator* surfaceConfigurator READ surfaceConfigurator CONSTANT) | 36 | Q_PROPERTY(SurfaceConfigurator* surfaceConfigurator READ surfaceConfigurator CONSTANT) |
109 | 37 | Q_PROPERTY(SurfaceSource* surfaceSource READ surfaceSource CONSTANT) | 37 | Q_PROPERTY(SurfaceFactory* surfaceFactory READ surfaceFactory CONSTANT) |
110 | 38 | 38 | ||
111 | 39 | public: | 39 | public: |
112 | 40 | ShellServerConfiguration(int argc, char const* argv[], QObject* parent = 0); | 40 | ShellServerConfiguration(int argc, char const* argv[], QObject* parent = 0); |
113 | @@ -54,11 +54,11 @@ | |||
114 | 54 | SessionAuthorizer *sessionAuthorizer(); | 54 | SessionAuthorizer *sessionAuthorizer(); |
115 | 55 | SessionListener *sessionListener(); | 55 | SessionListener *sessionListener(); |
116 | 56 | SurfaceConfigurator *surfaceConfigurator(); | 56 | SurfaceConfigurator *surfaceConfigurator(); |
118 | 57 | SurfaceSource *surfaceSource(); | 57 | SurfaceFactory *surfaceFactory(); |
119 | 58 | FocusSetter *focusSetter(); | 58 | FocusSetter *focusSetter(); |
120 | 59 | 59 | ||
121 | 60 | protected: | 60 | protected: |
123 | 61 | std::shared_ptr<SurfaceSource> m_surfaceSource; | 61 | std::shared_ptr<SurfaceFactory> m_surfaceFactory; |
124 | 62 | 62 | ||
125 | 63 | private: | 63 | private: |
126 | 64 | mir::CachedPtr<mir::shell::SurfaceBuilder> m_surfaceBuilder; | 64 | mir::CachedPtr<mir::shell::SurfaceBuilder> m_surfaceBuilder; |
127 | 65 | 65 | ||
128 | === renamed file 'src/unity-mir/surfacesource.cpp' => 'src/unity-mir/surfacefactory.cpp' | |||
129 | --- src/unity-mir/surfacesource.cpp 2013-08-12 11:12:48 +0000 | |||
130 | +++ src/unity-mir/surfacefactory.cpp 2013-10-30 17:46:58 +0000 | |||
131 | @@ -15,7 +15,7 @@ | |||
132 | 15 | */ | 15 | */ |
133 | 16 | 16 | ||
134 | 17 | // local | 17 | // local |
136 | 18 | #include "surfacesource.h" | 18 | #include "surfacefactory.h" |
137 | 19 | #include "logging.h" | 19 | #include "logging.h" |
138 | 20 | 20 | ||
139 | 21 | // mir | 21 | // mir |
140 | @@ -24,29 +24,27 @@ | |||
141 | 24 | 24 | ||
142 | 25 | namespace msh = mir::shell; | 25 | namespace msh = mir::shell; |
143 | 26 | 26 | ||
146 | 27 | SurfaceSource::SurfaceSource(std::shared_ptr<msh::SurfaceBuilder> const& surfaceBuilder, | 27 | SurfaceFactory::SurfaceFactory(std::shared_ptr<mir::shell::SurfaceFactory> const& surfaceFactory, |
145 | 28 | std::shared_ptr<mir::shell::SurfaceConfigurator> const& surfaceConfigurator, | ||
147 | 29 | QObject *parent) | 28 | QObject *parent) |
148 | 30 | : QObject(parent) | 29 | : QObject(parent) |
151 | 31 | , msh::SurfaceSource(surfaceBuilder, surfaceConfigurator) | 30 | , m_surfaceFactory(surfaceFactory) |
150 | 32 | , m_surfaceBuilder(surfaceBuilder) | ||
152 | 33 | { | 31 | { |
153 | 34 | qRegisterMetaType<std::shared_ptr<msh::Surface>>("std::shared_ptr<mir::shell::Surface>"); | 32 | qRegisterMetaType<std::shared_ptr<msh::Surface>>("std::shared_ptr<mir::shell::Surface>"); |
154 | 35 | } | 33 | } |
155 | 36 | 34 | ||
157 | 37 | SurfaceSource::~SurfaceSource() | 35 | SurfaceFactory::~SurfaceFactory() |
158 | 38 | { | 36 | { |
159 | 39 | } | 37 | } |
160 | 40 | 38 | ||
161 | 41 | std::shared_ptr<msh::Surface> | 39 | std::shared_ptr<msh::Surface> |
163 | 42 | SurfaceSource::create_surface( | 40 | SurfaceFactory::create_surface( |
164 | 43 | mir::shell::Session *session, | 41 | mir::shell::Session *session, |
165 | 44 | msh::SurfaceCreationParameters const& params, | 42 | msh::SurfaceCreationParameters const& params, |
166 | 45 | mir::frontend::SurfaceId id, | 43 | mir::frontend::SurfaceId id, |
167 | 46 | std::shared_ptr<mir::frontend::EventSink> const& sink) | 44 | std::shared_ptr<mir::frontend::EventSink> const& sink) |
168 | 47 | { | 45 | { |
171 | 48 | DLOG("SurfaceSource::create_surface"); | 46 | DLOG("SurfaceFactory::create_surface"); |
172 | 49 | std::shared_ptr<msh::Surface> mirSurface = msh::SurfaceSource::create_surface(session, params, id, sink); | 47 | std::shared_ptr<msh::Surface> mirSurface = m_surfaceFactory->create_surface(session, params, id, sink); |
173 | 50 | 48 | ||
174 | 51 | static bool shellSurfaceFound = false; //FIXME: Hack to work around fact unable to detect shell surface | 49 | static bool shellSurfaceFound = false; //FIXME: Hack to work around fact unable to detect shell surface |
175 | 52 | if (!shellSurfaceFound) { | 50 | if (!shellSurfaceFound) { |
176 | @@ -57,7 +55,7 @@ | |||
177 | 57 | return mirSurface; | 55 | return mirSurface; |
178 | 58 | } | 56 | } |
179 | 59 | 57 | ||
181 | 60 | std::shared_ptr<mir::shell::Surface> SurfaceSource::shellSurface() const | 58 | std::shared_ptr<mir::shell::Surface> SurfaceFactory::shellSurface() const |
182 | 61 | { | 59 | { |
183 | 62 | return m_shellSurface; | 60 | return m_shellSurface; |
184 | 63 | } | 61 | } |
185 | 64 | 62 | ||
186 | === renamed file 'src/unity-mir/surfacesource.h' => 'src/unity-mir/surfacefactory.h' | |||
187 | --- src/unity-mir/surfacesource.h 2013-08-12 11:12:48 +0000 | |||
188 | +++ src/unity-mir/surfacefactory.h 2013-10-30 17:46:58 +0000 | |||
189 | @@ -19,20 +19,18 @@ | |||
190 | 19 | 19 | ||
191 | 20 | #include <QObject> | 20 | #include <QObject> |
192 | 21 | 21 | ||
195 | 22 | #include "mir/shell/surface.h" | 22 | #include "mir/shell/surface_factory.h" |
194 | 23 | #include "mir/shell/surface_source.h" | ||
196 | 24 | 23 | ||
197 | 25 | Q_DECLARE_METATYPE(std::shared_ptr<mir::shell::Surface>) | 24 | Q_DECLARE_METATYPE(std::shared_ptr<mir::shell::Surface>) |
198 | 26 | 25 | ||
200 | 27 | class SurfaceSource : public QObject, public mir::shell::SurfaceSource | 26 | class SurfaceFactory : public QObject, public mir::shell::SurfaceFactory |
201 | 28 | { | 27 | { |
202 | 29 | Q_OBJECT | 28 | Q_OBJECT |
203 | 30 | 29 | ||
204 | 31 | public: | 30 | public: |
207 | 32 | SurfaceSource(std::shared_ptr<mir::shell::SurfaceBuilder> const& surfaceBuilder, | 31 | SurfaceFactory(std::shared_ptr<mir::shell::SurfaceFactory> const& surfaceFactory, |
206 | 33 | std::shared_ptr<mir::shell::SurfaceConfigurator> const& surfaceConfigurator, | ||
208 | 34 | QObject *parent = 0); | 32 | QObject *parent = 0); |
210 | 35 | ~SurfaceSource(); | 33 | ~SurfaceFactory(); |
211 | 36 | 34 | ||
212 | 37 | //Called by Mir server | 35 | //Called by Mir server |
213 | 38 | std::shared_ptr<mir::shell::Surface> create_surface( | 36 | std::shared_ptr<mir::shell::Surface> create_surface( |
214 | @@ -48,7 +46,7 @@ | |||
215 | 48 | void shellSurfaceCreated(std::shared_ptr<mir::shell::Surface> const& surface); | 46 | void shellSurfaceCreated(std::shared_ptr<mir::shell::Surface> const& surface); |
216 | 49 | 47 | ||
217 | 50 | private: | 48 | private: |
219 | 51 | const std::shared_ptr<mir::shell::SurfaceBuilder> m_surfaceBuilder; | 49 | const std::shared_ptr<mir::shell::SurfaceFactory> m_surfaceFactory; |
220 | 52 | std::shared_ptr<mir::shell::Surface> m_shellSurface; | 50 | std::shared_ptr<mir::shell::Surface> m_shellSurface; |
221 | 53 | }; | 51 | }; |
222 | 54 | 52 | ||
223 | 55 | 53 | ||
224 | === modified file 'src/unity-mir/unity-mir.pro' | |||
225 | --- src/unity-mir/unity-mir.pro 2013-10-28 12:59:18 +0000 | |||
226 | +++ src/unity-mir/unity-mir.pro 2013-10-30 17:46:58 +0000 | |||
227 | @@ -22,7 +22,7 @@ | |||
228 | 22 | sessionlistener.cpp \ | 22 | sessionlistener.cpp \ |
229 | 23 | shellserverconfiguration.cpp \ | 23 | shellserverconfiguration.cpp \ |
230 | 24 | surfacebuilder.cpp \ | 24 | surfacebuilder.cpp \ |
232 | 25 | surfacesource.cpp \ | 25 | surfacefactory.cpp \ |
233 | 26 | surfaceconfigurator.cpp \ | 26 | surfaceconfigurator.cpp \ |
234 | 27 | focussetter.cpp | 27 | focussetter.cpp |
235 | 28 | 28 | ||
236 | @@ -35,7 +35,7 @@ | |||
237 | 35 | sessionlistener.h \ | 35 | sessionlistener.h \ |
238 | 36 | shellserverconfiguration.h \ | 36 | shellserverconfiguration.h \ |
239 | 37 | surfacebuilder.h \ | 37 | surfacebuilder.h \ |
241 | 38 | surfacesource.h \ | 38 | surfacefactory.h \ |
242 | 39 | surfaceconfigurator.h \ | 39 | surfaceconfigurator.h \ |
243 | 40 | logging.h \ | 40 | logging.h \ |
244 | 41 | focussetter.h | 41 | focussetter.h |
245 | @@ -49,7 +49,7 @@ | |||
246 | 49 | sessionlistener.h \ | 49 | sessionlistener.h \ |
247 | 50 | shellserverconfiguration.h \ | 50 | shellserverconfiguration.h \ |
248 | 51 | surfacebuilder.h \ | 51 | surfacebuilder.h \ |
250 | 52 | surfacesource.h | 52 | surfacefactory.h |
251 | 53 | install_headers.path = /usr/include/unity-mir | 53 | install_headers.path = /usr/include/unity-mir |
252 | 54 | 54 | ||
253 | 55 | ### Generate pkg-config file | 55 | ### Generate pkg-config file |
PASSED: Continuous integration, rev:138 jenkins. qa.ubuntu. com/job/ unity-mir- ci/144/ jenkins. qa.ubuntu. com/job/ unity-mir- trusty- amd64-ci/ 5 jenkins. qa.ubuntu. com/job/ unity-mir- trusty- armhf-ci/ 5 jenkins. qa.ubuntu. com/job/ unity-mir- trusty- armhf-ci/ 5/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-mir- trusty- i386-ci/ 5
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 10.97.0. 26:8080/ job/unity- mir-ci/ 144/rebuild
http://