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
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2015-03-27 06:58:51 +0000
+++ examples/CMakeLists.txt 2015-03-27 17:01:01 +0000
@@ -21,7 +21,6 @@
21 server_example_input_event_filter.cpp21 server_example_input_event_filter.cpp
22 server_example_log_options.cpp22 server_example_log_options.cpp
23 server_example_input_filter.cpp23 server_example_input_filter.cpp
24 server_example_fullscreen_placement_strategy.cpp
25 server_example_host_lifecycle_event.cpp24 server_example_host_lifecycle_event.cpp
26 server_example_tiling_window_manager.cpp25 server_example_tiling_window_manager.cpp
27 server_example_window_management.cpp26 server_example_window_management.cpp
2827
=== removed file 'examples/server_example_fullscreen_placement_strategy.cpp'
--- examples/server_example_fullscreen_placement_strategy.cpp 2015-01-21 07:34:50 +0000
+++ examples/server_example_fullscreen_placement_strategy.cpp 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
1/*
2 * Copyright © 2013-2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#include "server_example_fullscreen_placement_strategy.h"
20
21#include "mir/server.h"
22#include "mir/options/option.h"
23#include "mir/scene/surface_creation_parameters.h"
24#include "mir/shell/display_layout.h"
25#include "mir/geometry/rectangle.h"
26
27namespace me = mir::examples;
28namespace ms = mir::scene;
29namespace msh = mir::shell;
30
31///\example server_example_fullscreen_placement_strategy.cpp
32/// Demonstrate a custom placement strategy (that fullscreens surfaces)
33
34me::FullscreenPlacementStrategy::FullscreenPlacementStrategy(
35 std::shared_ptr<msh::DisplayLayout> const& display_layout)
36 : display_layout(display_layout)
37{
38}
39
40ms::SurfaceCreationParameters me::FullscreenPlacementStrategy::place(ms::Session const& /* session */,
41 ms::SurfaceCreationParameters const& request_parameters)
42{
43 auto placed_parameters = request_parameters;
44
45 geometry::Rectangle rect{request_parameters.top_left, request_parameters.size};
46 display_layout->size_to_output(rect);
47 placed_parameters.size = rect.size;
48
49 return placed_parameters;
50}
51
52void me::add_fullscreen_option_to(Server& server)
53{
54 server.add_configuration_option("fullscreen-surfaces", "Make all surfaces fullscreen", mir::OptionType::null);
55 server.override_the_placement_strategy([&]()
56 -> std::shared_ptr<ms::PlacementStrategy>
57 {
58 if (server.get_options()->is_set("fullscreen-surfaces"))
59 return std::make_shared<me::FullscreenPlacementStrategy>(server.the_shell_display_layout());
60 else
61 return std::shared_ptr<ms::PlacementStrategy>{};
62 });
63}
640
=== removed file 'examples/server_example_fullscreen_placement_strategy.h'
--- examples/server_example_fullscreen_placement_strategy.h 2015-01-21 07:34:50 +0000
+++ examples/server_example_fullscreen_placement_strategy.h 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1/*
2 * Copyright © 2013-2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#ifndef MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
20#define MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
21
22#include "mir/scene/placement_strategy.h"
23
24#include <memory>
25
26namespace mir
27{
28class Server;
29
30namespace shell
31{
32class DisplayLayout;
33}
34
35namespace examples
36{
37class FullscreenPlacementStrategy : public virtual scene::PlacementStrategy
38{
39public:
40 FullscreenPlacementStrategy(std::shared_ptr<shell::DisplayLayout> const& display_layout);
41 ~FullscreenPlacementStrategy() = default;
42
43 scene::SurfaceCreationParameters place(scene::Session const&, scene::SurfaceCreationParameters const& request_parameters);
44
45protected:
46 FullscreenPlacementStrategy(FullscreenPlacementStrategy const&) = delete;
47 FullscreenPlacementStrategy& operator=(FullscreenPlacementStrategy const&) = delete;
48
49private:
50 std::shared_ptr<shell::DisplayLayout> const display_layout;
51};
52
53void add_fullscreen_option_to(Server& server);
54}
55} // namespace mir
56
57#endif // MIR_EXAMPLES_FULLSCREEN_PLACEMENT_STRATEGY_H_
580
=== modified file 'include/server/mir/server.h'
--- include/server/mir/server.h 2015-03-27 06:58:51 +0000
+++ include/server/mir/server.h 2015-03-27 17:01:01 +0000
@@ -44,12 +44,10 @@
44}44}
45namespace scene45namespace scene
46{46{
47class PlacementStrategy;
48class PromptSessionListener;47class PromptSessionListener;
49class PromptSessionManager;48class PromptSessionManager;
50class SessionListener;49class SessionListener;
51class SessionCoordinator;50class SessionCoordinator;
52class SurfaceConfigurator;
53class SurfaceCoordinator;51class SurfaceCoordinator;
54}52}
5553
@@ -228,9 +226,6 @@
228 /// Sets an override functor for creating the logger.226 /// Sets an override functor for creating the logger.
229 void override_the_logger(Builder<logging::Logger> const& logger_builder);227 void override_the_logger(Builder<logging::Logger> const& logger_builder);
230228
231 /// Sets an override functor for creating the placement strategy.
232 void override_the_placement_strategy(Builder<scene::PlacementStrategy> const& placement_strategy_builder);
233
234 /// Sets an override functor for creating the prompt session listener.229 /// Sets an override functor for creating the prompt session listener.
235 void override_the_prompt_session_listener(Builder<scene::PromptSessionListener> const& prompt_session_listener_builder);230 void override_the_prompt_session_listener(Builder<scene::PromptSessionListener> const& prompt_session_listener_builder);
236231
@@ -252,9 +247,6 @@
252 /// Sets an override functor for creating the shell.247 /// Sets an override functor for creating the shell.
253 void override_the_shell(Builder<shell::Shell> const& wrapper);248 void override_the_shell(Builder<shell::Shell> const& wrapper);
254249
255 /// Sets an override functor for creating the surface configurator.
256 void override_the_surface_configurator(Builder<scene::SurfaceConfigurator> const& surface_configurator_builder);
257
258 /// Sets an override functor for creating the window manager.250 /// Sets an override functor for creating the window manager.
259 void override_the_window_manager_builder(shell::WindowManagerBuilder const wmb);251 void override_the_window_manager_builder(shell::WindowManagerBuilder const wmb);
260252
@@ -335,9 +327,6 @@
335 /// \return the display layout.327 /// \return the display layout.
336 auto the_shell_display_layout() const -> std::shared_ptr<shell::DisplayLayout>;328 auto the_shell_display_layout() const -> std::shared_ptr<shell::DisplayLayout>;
337329
338 /// \return the surface configurator.
339 auto the_surface_configurator() const -> std::shared_ptr<scene::SurfaceConfigurator>;
340
341 /// \return the surface coordinator.330 /// \return the surface coordinator.
342 auto the_surface_coordinator() const -> std::shared_ptr<scene::SurfaceCoordinator>;331 auto the_surface_coordinator() const -> std::shared_ptr<scene::SurfaceCoordinator>;
343332
344333
=== modified file 'playground/demo-shell/demo_shell.cpp'
--- playground/demo-shell/demo_shell.cpp 2015-03-25 02:48:40 +0000
+++ playground/demo-shell/demo_shell.cpp 2015-03-27 17:01:01 +0000
@@ -20,10 +20,8 @@
2020
21#include "demo_compositor.h"21#include "demo_compositor.h"
22#include "window_manager.h"22#include "window_manager.h"
23#include "server_example_fullscreen_placement_strategy.h"
24#include "../server_configuration.h"23#include "../server_configuration.h"
2524
26#include "mir/options/default_configuration.h"
27#include "mir/run_mir.h"25#include "mir/run_mir.h"
28#include "mir/report_exception.h"26#include "mir/report_exception.h"
29#include "mir/graphics/display.h"27#include "mir/graphics/display.h"
@@ -40,7 +38,6 @@
40namespace mg = mir::graphics;38namespace mg = mir::graphics;
41namespace mf = mir::frontend;39namespace mf = mir::frontend;
42namespace mi = mir::input;40namespace mi = mir::input;
43namespace mo = mir::options;
44namespace mc = mir::compositor;41namespace mc = mir::compositor;
45namespace msh = mir::shell;42namespace msh = mir::shell;
4643
@@ -74,17 +71,7 @@
74public:71public:
75 DemoServerConfiguration(int argc, char const* argv[],72 DemoServerConfiguration(int argc, char const* argv[],
76 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)73 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
77 : ServerConfiguration([argc, argv]74 : ServerConfiguration(argc, argv),
78 {
79 auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
80
81 namespace po = boost::program_options;
82
83 result->add_options()
84 ("fullscreen-surfaces", "Make all surfaces fullscreen");
85
86 return result;
87 }()),
88 filter_list(filter_list)75 filter_list(filter_list)
89 {76 {
90 }77 }
@@ -100,18 +87,6 @@
100 });87 });
101 }88 }
10289
103 std::shared_ptr<ms::PlacementStrategy> the_placement_strategy() override
104 {
105 return placement_strategy(
106 [this]() -> std::shared_ptr<ms::PlacementStrategy>
107 {
108 if (the_options()->is_set("fullscreen-surfaces"))
109 return std::make_shared<me::FullscreenPlacementStrategy>(the_shell_display_layout());
110 else
111 return DefaultServerConfiguration::the_placement_strategy();
112 });
113 }
114
115 std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override90 std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override
116 {91 {
117 auto composite_filter = ServerConfiguration::the_composite_event_filter();92 auto composite_filter = ServerConfiguration::the_composite_event_filter();
11893
=== renamed file 'include/server/mir/scene/placement_strategy.h' => 'src/include/server/mir/scene/placement_strategy.h'
=== renamed file 'include/server/mir/scene/surface_configurator.h' => 'src/include/server/mir/scene/surface_configurator.h'
=== modified file 'src/server/scene/surface_controller.h'
--- src/server/scene/surface_controller.h 2015-03-25 02:48:40 +0000
+++ src/server/scene/surface_controller.h 2015-03-27 17:01:01 +0000
@@ -26,7 +26,6 @@
26{26{
27namespace scene27namespace scene
28{28{
29class PlacementStrategy;
30class SurfaceStackModel;29class SurfaceStackModel;
31class SurfaceFactory;30class SurfaceFactory;
3231
3332
=== modified file 'src/server/server.cpp'
--- src/server/server.cpp 2015-03-27 06:58:51 +0000
+++ src/server/server.cpp 2015-03-27 17:01:01 +0000
@@ -53,15 +53,13 @@
53 MACRO(host_lifecycle_event_listener)\53 MACRO(host_lifecycle_event_listener)\
54 MACRO(input_dispatcher)\54 MACRO(input_dispatcher)\
55 MACRO(logger)\55 MACRO(logger)\
56 MACRO(placement_strategy)\
57 MACRO(prompt_session_listener)\56 MACRO(prompt_session_listener)\
58 MACRO(prompt_session_manager)\57 MACRO(prompt_session_manager)\
59 MACRO(server_status_listener)\58 MACRO(server_status_listener)\
60 MACRO(session_authorizer)\59 MACRO(session_authorizer)\
61 MACRO(session_listener)\60 MACRO(session_listener)\
62 MACRO(session_mediator_report)\61 MACRO(session_mediator_report)\
63 MACRO(shell)\62 MACRO(shell)
64 MACRO(surface_configurator)
6563
66#define FOREACH_ACCESSOR(MACRO)\64#define FOREACH_ACCESSOR(MACRO)\
67 MACRO(the_compositor)\65 MACRO(the_compositor)\
@@ -82,7 +80,6 @@
82 MACRO(the_prompt_session_manager)\80 MACRO(the_prompt_session_manager)\
83 MACRO(the_shell)\81 MACRO(the_shell)\
84 MACRO(the_shell_display_layout)\82 MACRO(the_shell_display_layout)\
85 MACRO(the_surface_configurator)\
86 MACRO(the_surface_coordinator)\83 MACRO(the_surface_coordinator)\
87 MACRO(the_touch_visualizer)84 MACRO(the_touch_visualizer)
8885

Subscribers

People subscribed via source and target branches