Mir

Merge lp:~alan-griffiths/mir/remove-DefaultWindowManager 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: 3489
Proposed branch: lp:~alan-griffiths/mir/remove-DefaultWindowManager
Merge into: lp:mir
Diff against target: 404 lines (+5/-304)
6 files modified
playground/demo-shell/CMakeLists.txt (+0/-1)
playground/demo-shell/default_window_manager.cpp (+0/-150)
playground/demo-shell/default_window_manager.h (+0/-86)
playground/demo-shell/demo_shell.cpp (+5/-53)
playground/server_configuration.cpp (+0/-8)
playground/server_configuration.h (+0/-6)
To merge this branch: bzr merge lp:~alan-griffiths/mir/remove-DefaultWindowManager
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Daniel van Vugt Approve
Kevin DuBois (community) Approve
Cemil Azizoglu (community) Approve
Review via email: mp+292779@code.launchpad.net

Commit message

playground: get rid of the legacy DefaultWindowManager (and the --window-manager option) in mir_proving_server

Description of the change

playground: get rid of the legacy DefaultWindowManager (and the --window-manager option) in mir_proving_server

We have too many window managers around the system, and this one is pointless

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3476
https://mir-jenkins.ubuntu.com/job/mir-ci/895/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/931
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/970
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/961
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/961
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/941
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/941/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/941
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/941/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/941
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/941/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/941
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/941/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/941
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/941/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/895/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Yep.. Too many.

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

alright

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I was wondering why that was there... In theory: Approved.

In practice: Manual testing of this branch reveals that it breaks mir_proving_server's nice reliable resizing and moving. So I would prefer that we fix bug 1447886 before introducing it into mir_proving_server that is presently immune to bug 1447886.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I was wondering why that was there... In theory: Approved.
>
> In practice: Manual testing of this branch reveals that it breaks
> mir_proving_server's nice reliable resizing and moving. So I would prefer that
> we fix bug 1447886 before introducing it into mir_proving_server that is
> presently immune to bug 1447886.

AFAICS the principle difference is that the "canonical" window manager expects you to click on a window to resize or move it. (And, if you chose to size to 1x1 that can be tricky - but not impossible.)

In contrast mir_proving_server the window management currently resizes or moves the active window regardless of where you click. This happens even when you click on another window on another screen.

I'm not sure that the latter behaviour is worth preserving.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's not a show-stopper. And I really like the gist of this proposal. But I personally request that we don't break mir_proving_server till more bugs in the canonical window manager are fixed.

If this MP landed it would only motivate me to take a tangent and spend time fixing the canonical window manager, which I don't want to do. More details are in bug 1447886.

Also relevant is: https://trello.com/c/Ru4bK7J4

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> It's not a show-stopper. And I really like the gist of this proposal. But I
> personally request that we don't break mir_proving_server till more bugs in
> the canonical window manager are fixed.
>
> If this MP landed it would only motivate me to take a tangent and spend time
> fixing the canonical window manager, which I don't want to do. More details
> are in bug 1447886.

I've tried addressing your concerns in lp:~alan-griffiths/miral/revised-resize/+merge/293125

If that addresses your concerns we can proceed with this MP and I'll backport to Mir's CanonicalWindowManager.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It sounds good in theory (I haven't tested it). Land that one, and then let's see how this goes.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> It sounds good in theory (I haven't tested it). Land that one, and then let's
> see how this goes.

You can see the effect by trying lp:~alan-griffiths/mir/fix-1447886 with:

  $ bin/mir_proving_server --window-manager canonical

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I have a better theory - just let playground's WindowManager filter events first. That way the behaviour of proving_server doesn't change.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3478
https://mir-jenkins.ubuntu.com/job/mir-ci/921/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/974/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1020
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1011
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1011
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/984
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/984/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/984
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/984/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/984
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/984/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/984
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/984/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/984/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/921/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

13:17:36 Build timed out (after 180 minutes). Marking the build as aborted.
13:17:36 Build was aborted
13:17:36 Archiving artifacts
13:17:36 [WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] done
13:17:36 Finished: ABORTED

Rebuild triggered

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3478
https://mir-jenkins.ubuntu.com/job/mir-ci/925/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/978/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1024
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1015
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1015
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/988
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/988/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/988
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/988/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/988
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/988/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/988
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/988/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/988/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/925/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3478
https://mir-jenkins.ubuntu.com/job/mir-ci/926/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/979/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1025
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1016
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1016
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/989
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/989/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/989
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/989/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/989
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/989/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/989
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/989/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/989/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/926/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sure, looks like a good (smaller) step.

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playground/demo-shell/CMakeLists.txt'
2--- playground/demo-shell/CMakeLists.txt 2015-06-24 03:00:56 +0000
3+++ playground/demo-shell/CMakeLists.txt 2016-04-29 10:12:03 +0000
4@@ -2,7 +2,6 @@
5 demo_compositor.cpp
6 demo_renderer.cpp
7 window_manager.cpp
8- default_window_manager.cpp
9 )
10
11 add_subdirectory(typo)
12
13=== removed file 'playground/demo-shell/default_window_manager.cpp'
14--- playground/demo-shell/default_window_manager.cpp 2016-01-29 08:18:22 +0000
15+++ playground/demo-shell/default_window_manager.cpp 1970-01-01 00:00:00 +0000
16@@ -1,150 +0,0 @@
17-/*
18- * Copyright © 2015 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: Alan Griffiths <alan@octopull.co.uk>
33- */
34-
35-#include "default_window_manager.h"
36-
37-#include "mir/scene/session.h"
38-#include "mir/scene/session_coordinator.h"
39-#include "mir/scene/surface.h"
40-#include "mir/scene/surface_creation_parameters.h"
41-#include "mir/shell/display_layout.h"
42-#include "mir/shell/focus_controller.h"
43-#include "mir/shell/surface_ready_observer.h"
44-#include "mir/shell/surface_specification.h"
45-
46-#include "mir_toolkit/client_types.h"
47-
48-namespace mf = mir::frontend;
49-namespace ms = mir::scene;
50-namespace msh = mir::shell;
51-namespace me = mir::examples;
52-namespace geom = mir::geometry;
53-
54-me::DefaultWindowManager::DefaultWindowManager(
55- msh::FocusController* focus_controller,
56- std::shared_ptr<shell::DisplayLayout> const& display_layout,
57- std::shared_ptr<scene::SessionCoordinator> const& session_coordinator) :
58- focus_controller{focus_controller},
59- display_layout{display_layout},
60- session_coordinator{session_coordinator}
61-{
62-}
63-
64-void me::DefaultWindowManager::add_session(std::shared_ptr<scene::Session> const& session)
65-{
66- focus_controller->set_focus_to(session, {});
67-}
68-
69-void me::DefaultWindowManager::remove_session(std::shared_ptr<scene::Session> const& /*session*/)
70-{
71- auto const next_session = session_coordinator->successor_of({});
72- if (next_session)
73- focus_controller->set_focus_to(next_session, next_session->default_surface());
74- else
75- focus_controller->set_focus_to(next_session, {});
76-}
77-
78-auto me::DefaultWindowManager::add_surface(
79- std::shared_ptr<scene::Session> const& session,
80- scene::SurfaceCreationParameters const& request_parameters,
81- std::function<frontend::SurfaceId(std::shared_ptr<scene::Session> const& session, scene::SurfaceCreationParameters const& params)> const& build)
82--> frontend::SurfaceId
83-{
84- mir::graphics::DisplayConfigurationOutputId const output_id_invalid{
85- mir_display_output_id_invalid};
86- auto placed_parameters = request_parameters;
87-
88- geom::Rectangle rect{request_parameters.top_left, request_parameters.size};
89-
90- if (request_parameters.output_id != output_id_invalid)
91- {
92- display_layout->place_in_output(request_parameters.output_id, rect);
93- }
94-
95- placed_parameters.top_left = rect.top_left;
96- placed_parameters.size = rect.size;
97-
98- auto const result = build(session, placed_parameters);
99- auto const surface = session->surface(result);
100-
101- surface->add_observer(std::make_shared<msh::SurfaceReadyObserver>(
102- [this](std::shared_ptr<scene::Session> const& session,
103- std::shared_ptr<scene::Surface> const& surface)
104- {
105- focus_controller->set_focus_to(session, surface);
106- },
107- session,
108- surface));
109-
110- return result;
111-}
112-
113-void me::DefaultWindowManager::modify_surface(
114- std::shared_ptr<scene::Session> const& /*session*/,
115- std::shared_ptr<scene::Surface> const& surface,
116- msh::SurfaceSpecification const& modifications)
117-{
118- if (modifications.name.is_set())
119- surface->rename(modifications.name.value());
120-}
121-
122-void me::DefaultWindowManager::remove_surface(
123- std::shared_ptr<scene::Session> const& session,
124- std::weak_ptr<scene::Surface> const& surface)
125-{
126- session->destroy_surface(surface);
127-}
128-
129-void me::DefaultWindowManager::add_display(geometry::Rectangle const& /*area*/)
130-{
131-}
132-
133-void me::DefaultWindowManager::remove_display(geometry::Rectangle const& /*area*/)
134-{
135-}
136-
137-void me::DefaultWindowManager::handle_raise_surface(
138- std::shared_ptr<scene::Session> const& /*session*/,
139- std::shared_ptr<scene::Surface> const& /*surface*/,
140- uint64_t /*timestamp*/)
141-{
142-}
143-
144-bool me::DefaultWindowManager::handle_keyboard_event(MirKeyboardEvent const* /*event*/)
145-{
146- return false;
147-}
148-
149-bool me::DefaultWindowManager::handle_touch_event(MirTouchEvent const* /*event*/)
150-{
151- return false;
152-}
153-
154-bool me::DefaultWindowManager::handle_pointer_event(MirPointerEvent const* /*event*/)
155-{
156- return false;
157-}
158-
159-int me::DefaultWindowManager::set_surface_attribute(
160- std::shared_ptr<scene::Session> const& /*session*/,
161- std::shared_ptr<scene::Surface> const& surface,
162- MirSurfaceAttrib attrib,
163- int value)
164-{
165- return surface->configure(attrib, value);
166-}
167
168=== removed file 'playground/demo-shell/default_window_manager.h'
169--- playground/demo-shell/default_window_manager.h 2016-01-29 08:18:22 +0000
170+++ playground/demo-shell/default_window_manager.h 1970-01-01 00:00:00 +0000
171@@ -1,86 +0,0 @@
172-/*
173- * Copyright © 2015 Canonical Ltd.
174- *
175- * This program is free software: you can redistribute it and/or modify it
176- * under the terms of the GNU General Public License version 3,
177- * as published by the Free Software Foundation.
178- *
179- * This program is distributed in the hope that it will be useful,
180- * but WITHOUT ANY WARRANTY; without even the implied warranty of
181- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
182- * GNU General Public License for more details.
183- *
184- * You should have received a copy of the GNU General Public License
185- * along with this program. If not, see <http://www.gnu.org/licenses/>.
186- *
187- * Authored By: Alan Griffiths <alan@octopull.co.uk>
188- */
189-
190-#ifndef MIR_EXAMPLES_DEFAULT_WINDOW_MANAGER_H_
191-#define MIR_EXAMPLES_DEFAULT_WINDOW_MANAGER_H_
192-
193-#include "mir/shell/window_manager.h"
194-
195-namespace mir
196-{
197-namespace scene { class SessionCoordinator; }
198-
199-namespace shell { class FocusController; class DisplayLayout; }
200-
201-namespace examples
202-{
203-class DefaultWindowManager : public shell::WindowManager
204-{
205-public:
206- explicit DefaultWindowManager(shell::FocusController* focus_controller,
207- std::shared_ptr<shell::DisplayLayout> const& display_layout,
208- std::shared_ptr<scene::SessionCoordinator> const& session_coordinator);
209-
210- void add_session(std::shared_ptr<scene::Session> const& session) override;
211-
212- void remove_session(std::shared_ptr<scene::Session> const& session) override;
213-
214- frontend::SurfaceId add_surface(
215- std::shared_ptr<scene::Session> const& session,
216- scene::SurfaceCreationParameters const& params,
217- std::function<frontend::SurfaceId(std::shared_ptr<scene::Session> const& session, scene::SurfaceCreationParameters const& params)> const& build) override;
218-
219- void modify_surface(
220- std::shared_ptr<scene::Session> const& session,
221- std::shared_ptr<scene::Surface> const& surface,
222- shell::SurfaceSpecification const& modifications) override;
223-
224- void remove_surface(
225- std::shared_ptr<scene::Session> const& session,
226- std::weak_ptr<scene::Surface> const& surface) override;
227-
228- void add_display(geometry::Rectangle const& area) override;
229-
230- void remove_display(geometry::Rectangle const& area) override;
231-
232- bool handle_keyboard_event(MirKeyboardEvent const* event) override;
233-
234- bool handle_touch_event(MirTouchEvent const* event) override;
235-
236- bool handle_pointer_event(MirPointerEvent const* event) override;
237-
238- void handle_raise_surface(
239- std::shared_ptr<scene::Session> const& session,
240- std::shared_ptr<scene::Surface> const& surface,
241- uint64_t timestamp) override;
242-
243- int set_surface_attribute(
244- std::shared_ptr<scene::Session> const& session,
245- std::shared_ptr<scene::Surface> const& surface,
246- MirSurfaceAttrib attrib,
247- int value) override;
248-
249-private:
250- shell::FocusController* const focus_controller;
251- std::shared_ptr<shell::DisplayLayout> const display_layout;
252- std::shared_ptr<scene::SessionCoordinator> const session_coordinator;
253-};
254-}
255-}
256-
257-#endif /* MIR_SHELL_DEFAULT_WINDOW_MANAGER_H_ */
258
259=== modified file 'playground/demo-shell/demo_shell.cpp'
260--- playground/demo-shell/demo_shell.cpp 2016-01-29 08:18:22 +0000
261+++ playground/demo-shell/demo_shell.cpp 2016-04-29 10:12:03 +0000
262@@ -29,9 +29,6 @@
263 #include "mir/compositor/display_buffer_compositor_factory.h"
264 #include "mir/compositor/renderer_factory.h"
265 #include "mir/options/option.h"
266-#include "default_window_manager.h"
267-#include "server_example_tiling_window_manager.h"
268-#include "mir/shell/canonical_window_manager.h"
269 #include "server_example_host_lifecycle_event_listener.h"
270
271 #include <iostream>
272@@ -71,13 +68,7 @@
273 class DemoServerConfiguration : public mir::examples::ServerConfiguration
274 {
275 public:
276- DemoServerConfiguration(int argc, char const* argv[],
277- std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
278- : ServerConfiguration(argc, argv),
279- filter_list(filter_list)
280- {
281- }
282-
283+ using mir::examples::ServerConfiguration::ServerConfiguration;
284
285 std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory() override
286 {
287@@ -89,45 +80,6 @@
288 });
289 }
290
291- std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override
292- {
293- return composite_event_filter(
294- [this]() -> std::shared_ptr<mi::CompositeEventFilter>
295- {
296- auto composite_filter = ServerConfiguration::the_composite_event_filter();
297- for (auto const& filter : filter_list)
298- composite_filter->append(filter);
299-
300- return composite_filter;
301- });
302- }
303-
304- auto the_window_manager_builder() -> shell::WindowManagerBuilder override
305- {
306- return [this](shell::FocusController* focus_controller)
307- -> std::shared_ptr<msh::WindowManager>
308- {
309- auto const options = the_options();
310- auto const selection = options->get<std::string>(wm_option);
311-
312- if (selection == wm_tiling)
313- {
314- return std::make_shared<TilingWindowManager>(focus_controller);
315- }
316- else if (selection == wm_canonical)
317- {
318- return std::make_shared<msh::CanonicalWindowManager>(
319- focus_controller,
320- the_shell_display_layout());
321- }
322-
323- return std::make_shared<DefaultWindowManager>(
324- focus_controller,
325- the_shell_display_layout(),
326- the_session_coordinator());
327- };
328- }
329-
330 std::shared_ptr<msh::HostLifecycleEventListener> the_host_lifecycle_event_listener() override
331 {
332 return host_lifecycle_event_listener(
333@@ -136,9 +88,6 @@
334 return std::make_shared<HostLifecycleEventListener>(the_logger());
335 });
336 }
337-
338-private:
339- std::vector<std::shared_ptr<mi::EventFilter>> const filter_list;
340 };
341
342 }
343@@ -147,8 +96,9 @@
344 int main(int argc, char const* argv[])
345 try
346 {
347+ me::DemoServerConfiguration config(argc, argv);
348+
349 auto wm = std::make_shared<me::WindowManager>();
350- me::DemoServerConfiguration config(argc, argv, {wm});
351
352 mir::run_mir(config, [&config, &wm](mir::DisplayServer&)
353 {
354@@ -158,6 +108,8 @@
355 wm->set_display(config.the_display());
356 wm->set_compositor(config.the_compositor());
357 wm->set_input_scene(config.the_input_scene());
358+
359+ config.the_composite_event_filter()->prepend(wm);
360 });
361 return 0;
362 }
363
364=== modified file 'playground/server_configuration.cpp'
365--- playground/server_configuration.cpp 2015-06-25 13:43:43 +0000
366+++ playground/server_configuration.cpp 2016-04-29 10:12:03 +0000
367@@ -28,12 +28,6 @@
368 namespace me = mir::examples;
369 namespace mg = mir::graphics;
370
371-char const* const me::wm_option = "window-manager";
372-char const* const me::wm_description = "window management strategy [{legacy|canonical|tiling}]";
373-char const* const me::wm_tiling = "tiling";
374-char const* const me::wm_legacy = "legacy";
375-char const* const me::wm_canonical = "canonical";
376-
377 me::ServerConfiguration::ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options) :
378 DefaultServerConfiguration(configuration_options)
379 {
380@@ -42,8 +36,6 @@
381 configuration_options->add_options()
382 (me::display_config_opt, po::value<std::string>()->default_value(me::clone_opt_val),
383 me::display_config_descr);
384- configuration_options->add_options()
385- (wm_option, po::value<std::string>()->default_value(wm_legacy), wm_description);
386 }
387
388 me::ServerConfiguration::ServerConfiguration(int argc, char const** argv) :
389
390=== modified file 'playground/server_configuration.h'
391--- playground/server_configuration.h 2015-06-17 05:20:42 +0000
392+++ playground/server_configuration.h 2016-04-29 10:12:03 +0000
393@@ -43,12 +43,6 @@
394 private:
395 std::shared_ptr<input::EventFilter> quit_filter;
396 };
397-
398-extern char const* const wm_option;
399-extern char const* const wm_description;
400-extern char const* const wm_tiling;
401-extern char const* const wm_legacy;
402-extern char const* const wm_canonical;
403 }
404 }
405

Subscribers

People subscribed via source and target branches