Mir

Merge lp:~alan-griffiths/mir/unpublish-legacy-window-managment-customization into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2444
Proposed branch: lp:~alan-griffiths/mir/unpublish-legacy-window-managment-customization
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/default-to-canonical-window-manager
Diff against target: 291 lines (+2/-163)
7 files modified
examples/CMakeLists.txt (+0/-1)
examples/server_example_fullscreen_placement_strategy.cpp (+0/-63)
examples/server_example_fullscreen_placement_strategy.h (+0/-57)
include/server/mir/server.h (+0/-11)
playground/demo-shell/demo_shell.cpp (+1/-26)
src/server/scene/surface_controller.h (+0/-1)
src/server/server.cpp (+1/-4)
To merge this branch: bzr merge lp:~alan-griffiths/mir/unpublish-legacy-window-managment-customization
Reviewer Review Type Date Requested Status
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Kevin DuBois (community) Approve
Daniel van Vugt Approve
Review via email: mp+253967@code.launchpad.net

Commit message

scene: unpublish customization points for legacy window management

Description of the change

scene: unpublish customization points for legacy window management

These are not being used downstream as they are inadequate for any sensible usage.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Happy to remove it from playground too. No good reason why it should reside there either.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

okay by me, I think removal from examples is better than moving to playground too

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/CMakeLists.txt'
2--- examples/CMakeLists.txt 2015-03-27 06:58:51 +0000
3+++ examples/CMakeLists.txt 2015-03-27 17:01:01 +0000
4@@ -21,7 +21,6 @@
5 server_example_input_event_filter.cpp
6 server_example_log_options.cpp
7 server_example_input_filter.cpp
8- server_example_fullscreen_placement_strategy.cpp
9 server_example_host_lifecycle_event.cpp
10 server_example_tiling_window_manager.cpp
11 server_example_window_management.cpp
12
13=== removed file 'examples/server_example_fullscreen_placement_strategy.cpp'
14--- examples/server_example_fullscreen_placement_strategy.cpp 2015-01-21 07:34:50 +0000
15+++ examples/server_example_fullscreen_placement_strategy.cpp 1970-01-01 00:00:00 +0000
16@@ -1,63 +0,0 @@
17-/*
18- * Copyright © 2013-2014 Canonical Ltd.
19- *
20- * This program is free software: you can redistribute it and/or modify it
21- * under the terms of the GNU General Public License version 3,
22- * as published by the Free Software Foundation.
23- *
24- * This program is distributed in the hope that it will be useful,
25- * but WITHOUT ANY WARRANTY; without even the implied warranty of
26- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27- * GNU General Public License for more details.
28- *
29- * You should have received a copy of the GNU General Public License
30- * along with this program. If not, see <http://www.gnu.org/licenses/>.
31- *
32- * Authored by: Robert Carr <robert.carr@canonical.com>
33- */
34-
35-#include "server_example_fullscreen_placement_strategy.h"
36-
37-#include "mir/server.h"
38-#include "mir/options/option.h"
39-#include "mir/scene/surface_creation_parameters.h"
40-#include "mir/shell/display_layout.h"
41-#include "mir/geometry/rectangle.h"
42-
43-namespace me = mir::examples;
44-namespace ms = mir::scene;
45-namespace msh = mir::shell;
46-
47-///\example server_example_fullscreen_placement_strategy.cpp
48-/// Demonstrate a custom placement strategy (that fullscreens surfaces)
49-
50-me::FullscreenPlacementStrategy::FullscreenPlacementStrategy(
51- std::shared_ptr<msh::DisplayLayout> const& display_layout)
52- : display_layout(display_layout)
53-{
54-}
55-
56-ms::SurfaceCreationParameters me::FullscreenPlacementStrategy::place(ms::Session const& /* session */,
57- ms::SurfaceCreationParameters const& request_parameters)
58-{
59- auto placed_parameters = request_parameters;
60-
61- geometry::Rectangle rect{request_parameters.top_left, request_parameters.size};
62- display_layout->size_to_output(rect);
63- placed_parameters.size = rect.size;
64-
65- return placed_parameters;
66-}
67-
68-void me::add_fullscreen_option_to(Server& server)
69-{
70- server.add_configuration_option("fullscreen-surfaces", "Make all surfaces fullscreen", mir::OptionType::null);
71- server.override_the_placement_strategy([&]()
72- -> std::shared_ptr<ms::PlacementStrategy>
73- {
74- if (server.get_options()->is_set("fullscreen-surfaces"))
75- return std::make_shared<me::FullscreenPlacementStrategy>(server.the_shell_display_layout());
76- else
77- return std::shared_ptr<ms::PlacementStrategy>{};
78- });
79-}
80
81=== removed file 'examples/server_example_fullscreen_placement_strategy.h'
82--- examples/server_example_fullscreen_placement_strategy.h 2015-01-21 07:34:50 +0000
83+++ examples/server_example_fullscreen_placement_strategy.h 1970-01-01 00:00:00 +0000
84@@ -1,57 +0,0 @@
85-/*
86- * Copyright © 2013-2014 Canonical Ltd.
87- *
88- * This program is free software: you can redistribute it and/or modify it
89- * under the terms of the GNU General Public License version 3,
90- * as published by the Free Software Foundation.
91- *
92- * This program is distributed in the hope that it will be useful,
93- * but WITHOUT ANY WARRANTY; without even the implied warranty of
94- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95- * GNU General Public License for more details.
96- *
97- * You should have received a copy of the GNU General Public License
98- * along with this program. If not, see <http://www.gnu.org/licenses/>.
99- *
100- * Authored by: Robert Carr <robert.carr@canonical.com>
101- */
102-
103-#ifndef MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
104-#define MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
105-
106-#include "mir/scene/placement_strategy.h"
107-
108-#include <memory>
109-
110-namespace mir
111-{
112-class Server;
113-
114-namespace shell
115-{
116-class DisplayLayout;
117-}
118-
119-namespace examples
120-{
121-class FullscreenPlacementStrategy : public virtual scene::PlacementStrategy
122-{
123-public:
124- FullscreenPlacementStrategy(std::shared_ptr<shell::DisplayLayout> const& display_layout);
125- ~FullscreenPlacementStrategy() = default;
126-
127- scene::SurfaceCreationParameters place(scene::Session const&, scene::SurfaceCreationParameters const& request_parameters);
128-
129-protected:
130- FullscreenPlacementStrategy(FullscreenPlacementStrategy const&) = delete;
131- FullscreenPlacementStrategy& operator=(FullscreenPlacementStrategy const&) = delete;
132-
133-private:
134- std::shared_ptr<shell::DisplayLayout> const display_layout;
135-};
136-
137-void add_fullscreen_option_to(Server& server);
138-}
139-} // namespace mir
140-
141-#endif // MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
142
143=== modified file 'include/server/mir/server.h'
144--- include/server/mir/server.h 2015-03-27 06:58:51 +0000
145+++ include/server/mir/server.h 2015-03-27 17:01:01 +0000
146@@ -44,12 +44,10 @@
147 }
148 namespace scene
149 {
150-class PlacementStrategy;
151 class PromptSessionListener;
152 class PromptSessionManager;
153 class SessionListener;
154 class SessionCoordinator;
155-class SurfaceConfigurator;
156 class SurfaceCoordinator;
157 }
158
159@@ -228,9 +226,6 @@
160 /// Sets an override functor for creating the logger.
161 void override_the_logger(Builder<logging::Logger> const& logger_builder);
162
163- /// Sets an override functor for creating the placement strategy.
164- void override_the_placement_strategy(Builder<scene::PlacementStrategy> const& placement_strategy_builder);
165-
166 /// Sets an override functor for creating the prompt session listener.
167 void override_the_prompt_session_listener(Builder<scene::PromptSessionListener> const& prompt_session_listener_builder);
168
169@@ -252,9 +247,6 @@
170 /// Sets an override functor for creating the shell.
171 void override_the_shell(Builder<shell::Shell> const& wrapper);
172
173- /// Sets an override functor for creating the surface configurator.
174- void override_the_surface_configurator(Builder<scene::SurfaceConfigurator> const& surface_configurator_builder);
175-
176 /// Sets an override functor for creating the window manager.
177 void override_the_window_manager_builder(shell::WindowManagerBuilder const wmb);
178
179@@ -335,9 +327,6 @@
180 /// \return the display layout.
181 auto the_shell_display_layout() const -> std::shared_ptr<shell::DisplayLayout>;
182
183- /// \return the surface configurator.
184- auto the_surface_configurator() const -> std::shared_ptr<scene::SurfaceConfigurator>;
185-
186 /// \return the surface coordinator.
187 auto the_surface_coordinator() const -> std::shared_ptr<scene::SurfaceCoordinator>;
188
189
190=== modified file 'playground/demo-shell/demo_shell.cpp'
191--- playground/demo-shell/demo_shell.cpp 2015-03-25 02:48:40 +0000
192+++ playground/demo-shell/demo_shell.cpp 2015-03-27 17:01:01 +0000
193@@ -20,10 +20,8 @@
194
195 #include "demo_compositor.h"
196 #include "window_manager.h"
197-#include "server_example_fullscreen_placement_strategy.h"
198 #include "../server_configuration.h"
199
200-#include "mir/options/default_configuration.h"
201 #include "mir/run_mir.h"
202 #include "mir/report_exception.h"
203 #include "mir/graphics/display.h"
204@@ -40,7 +38,6 @@
205 namespace mg = mir::graphics;
206 namespace mf = mir::frontend;
207 namespace mi = mir::input;
208-namespace mo = mir::options;
209 namespace mc = mir::compositor;
210 namespace msh = mir::shell;
211
212@@ -74,17 +71,7 @@
213 public:
214 DemoServerConfiguration(int argc, char const* argv[],
215 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
216- : ServerConfiguration([argc, argv]
217- {
218- auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
219-
220- namespace po = boost::program_options;
221-
222- result->add_options()
223- ("fullscreen-surfaces", "Make all surfaces fullscreen");
224-
225- return result;
226- }()),
227+ : ServerConfiguration(argc, argv),
228 filter_list(filter_list)
229 {
230 }
231@@ -100,18 +87,6 @@
232 });
233 }
234
235- std::shared_ptr<ms::PlacementStrategy> the_placement_strategy() override
236- {
237- return placement_strategy(
238- [this]() -> std::shared_ptr<ms::PlacementStrategy>
239- {
240- if (the_options()->is_set("fullscreen-surfaces"))
241- return std::make_shared<me::FullscreenPlacementStrategy>(the_shell_display_layout());
242- else
243- return DefaultServerConfiguration::the_placement_strategy();
244- });
245- }
246-
247 std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override
248 {
249 auto composite_filter = ServerConfiguration::the_composite_event_filter();
250
251=== renamed file 'include/server/mir/scene/placement_strategy.h' => 'src/include/server/mir/scene/placement_strategy.h'
252=== renamed file 'include/server/mir/scene/surface_configurator.h' => 'src/include/server/mir/scene/surface_configurator.h'
253=== modified file 'src/server/scene/surface_controller.h'
254--- src/server/scene/surface_controller.h 2015-03-25 02:48:40 +0000
255+++ src/server/scene/surface_controller.h 2015-03-27 17:01:01 +0000
256@@ -26,7 +26,6 @@
257 {
258 namespace scene
259 {
260-class PlacementStrategy;
261 class SurfaceStackModel;
262 class SurfaceFactory;
263
264
265=== modified file 'src/server/server.cpp'
266--- src/server/server.cpp 2015-03-27 06:58:51 +0000
267+++ src/server/server.cpp 2015-03-27 17:01:01 +0000
268@@ -53,15 +53,13 @@
269 MACRO(host_lifecycle_event_listener)\
270 MACRO(input_dispatcher)\
271 MACRO(logger)\
272- MACRO(placement_strategy)\
273 MACRO(prompt_session_listener)\
274 MACRO(prompt_session_manager)\
275 MACRO(server_status_listener)\
276 MACRO(session_authorizer)\
277 MACRO(session_listener)\
278 MACRO(session_mediator_report)\
279- MACRO(shell)\
280- MACRO(surface_configurator)
281+ MACRO(shell)
282
283 #define FOREACH_ACCESSOR(MACRO)\
284 MACRO(the_compositor)\
285@@ -82,7 +80,6 @@
286 MACRO(the_prompt_session_manager)\
287 MACRO(the_shell)\
288 MACRO(the_shell_display_layout)\
289- MACRO(the_surface_configurator)\
290 MACRO(the_surface_coordinator)\
291 MACRO(the_touch_visualizer)
292

Subscribers

People subscribed via source and target branches