Mir

Merge lp:~alan-griffiths/mir/fix-Surface-hierarchy-make-SessionContainer-private 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: 1227
Proposed branch: lp:~alan-griffiths/mir/fix-Surface-hierarchy-make-SessionContainer-private
Merge into: lp:mir
Diff against target: 547 lines (+68/-74)
24 files modified
examples/demo-shell/demo_shell.cpp (+0/-1)
include/server/mir/default_server_configuration.h (+1/-0)
include/server/mir/frontend/shell.h (+2/-2)
include/server/mir/shell/session_manager.h (+1/-9)
src/server/frontend/CMakeLists.txt (+0/-1)
src/server/frontend/default_configuration.cpp (+4/-23)
src/server/frontend/published_socket_connector.cpp (+5/-5)
src/server/frontend/published_socket_connector.h (+3/-3)
src/server/shell/CMakeLists.txt (+1/-0)
src/server/shell/default_configuration.cpp (+28/-1)
src/server/shell/default_session_container.cpp (+0/-1)
src/server/shell/default_session_container.h (+1/-1)
src/server/shell/global_event_sender.cpp (+5/-6)
src/server/shell/global_event_sender.h (+7/-9)
src/server/shell/mediating_display_changer.cpp (+1/-1)
src/server/shell/session_manager.cpp (+1/-1)
tests/acceptance-tests/test_client_input.cpp (+1/-1)
tests/acceptance-tests/test_display_configuration.cpp (+1/-1)
tests/acceptance-tests/test_focus_selection.cpp (+1/-1)
tests/integration-tests/test_display_info.cpp (+0/-1)
tests/unit-tests/frontend/CMakeLists.txt (+0/-1)
tests/unit-tests/shell/CMakeLists.txt (+1/-0)
tests/unit-tests/shell/test_global_event_sender.cpp (+3/-4)
tests/unit-tests/shell/test_mediating_display_changer.cpp (+1/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-Surface-hierarchy-make-SessionContainer-private
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Review via email: mp+194908@code.launchpad.net

Commit message

shell: don't publish SurfacesContainer - it can be private to shell.

Description of the change

shell: don't publish SurfacesContainer - it can be private to shell.

This MP disentangles SurfacesContainer from frontend, and makes it private to shell.

It and much of the code that uses it (default_session_container.cpp, global_event_sender.cpp, mediating_display_changer.cpp and session_manager.cpp) probably belong in surfaces. But that is for a future date.

NB this currently breaks unity-system-compositor, but that will be sorted long before this hits lp:mir.

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

overall looks okay. I agree with "It and much of the code that uses it (default_session_container.cpp, global_event_sender.cpp, mediating_display_changer.cpp and session_manager.cpp) probably belong in surfaces. "

the_for_all_sessions_force_requests_to_complete_functor is a funny name... the_force_all_requests_to_complete_functor() was the only name I could come up with....

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

> the_for_all_sessions_force_requests_to_complete_functor is a funny name...
> the_force_all_requests_to_complete_functor() was the only name I could come up
> with....

It is a funny name for a funny abstraction. It is hard to see why the Connector should have responsibility for calling into the data model like this. In practice, the connector owns the threads that must be joined (and therefore first unblocked) and I can't immediately think of a better approach.

For example: Keeping thing within "frontend" the SessionCreator tracks SocketSessions and these own MessageProcessors (implemented as ProtobufMessageProcessor) and these own a DisplayServer (implemented as SessionMediator) and that has a Session which has surfaces... So we could add corresponding "unblock" calls through this stack instead and avoid this strange functor. But that, I feel is a story for another MP.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

> the_for_all_sessions_force_requests_to_complete_functor is a funny name...
> the_force_all_requests_to_complete_functor() was the only name I could come up with....

I think the_force_all_requests_to_complete_functor() or the_force_all_(client|session)_requests_to_complete_functor()
are a bit more straightforward, but not a blocker.

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

> Looks good.
>
> > the_for_all_sessions_force_requests_to_complete_functor is a funny name...
> > the_force_all_requests_to_complete_functor() was the only name I could come
> up with....
>
> I think the_force_all_requests_to_complete_functor() or
> the_force_all_(client|session)_requests_to_complete_functor()
> are a bit more straightforward, but not a blocker.

I'm willing to be outvoted but I don't think these names are improvements:

1. These suggestions breaks up the "force_requests_to_complete" name of the function to be called for each session..

2. "the_force_all_requests_to_complete_functor()" as part of the system configuration lacks context. I think that is supplied by "for_all_sessions".

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

I like the idea. But I think there comes a point where wordiness is a significant hurdle to readability:

129 + auto const& force_requests_to_complete = the_for_all_sessions_force_requests_to_complete_functor();

189 +mir::DefaultServerConfiguration::the_for_all_sessions_force_requests_to_complete_functor()

Remember people see and read words as singular symbols, not looking at individual letters. If the symbol is too complex to recognize without looking at individual letters, then it's not really readable.

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

In the context of programming, it's the entire identifier (all words together) that needs to be recognizable as a single symbol. Not just the individual words within it.

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

Yep, better thanks.

I find it strange to be returning a function from a function, and suspect a better design is possible. But won't pause to try and redesign existing semantics.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/demo-shell/demo_shell.cpp'
--- examples/demo-shell/demo_shell.cpp 2013-11-04 05:59:29 +0000
+++ examples/demo-shell/demo_shell.cpp 2013-11-15 09:55:09 +0000
@@ -24,7 +24,6 @@
2424
25#include "mir/run_mir.h"25#include "mir/run_mir.h"
26#include "mir/report_exception.h"26#include "mir/report_exception.h"
27#include "mir/shell/session_container.h"
28#include "mir/graphics/display.h"27#include "mir/graphics/display.h"
29#include "mir/input/composite_event_filter.h"28#include "mir/input/composite_event_filter.h"
3029
3130
=== modified file 'include/server/mir/default_server_configuration.h'
--- include/server/mir/default_server_configuration.h 2013-11-12 11:07:59 +0000
+++ include/server/mir/default_server_configuration.h 2013-11-15 09:55:09 +0000
@@ -312,6 +312,7 @@
312 std::shared_ptr<input::NestedInputRelay> the_nested_input_relay();312 std::shared_ptr<input::NestedInputRelay> the_nested_input_relay();
313 std::shared_ptr<surfaces::SurfaceBuilder> the_surface_builder();313 std::shared_ptr<surfaces::SurfaceBuilder> the_surface_builder();
314 std::shared_ptr<surfaces::SurfaceController> the_surface_controller();314 std::shared_ptr<surfaces::SurfaceController> the_surface_controller();
315 std::function<void()> force_threads_to_unblock_callback();
315};316};
316}317}
317318
318319
=== modified file 'include/server/mir/frontend/shell.h'
--- include/server/mir/frontend/shell.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/frontend/shell.h 2013-11-15 09:55:09 +0000
@@ -36,7 +36,7 @@
36class Shell36class Shell
37{37{
38public:38public:
39 virtual ~Shell() {}39 virtual ~Shell() = default;
4040
41 virtual std::shared_ptr<Session> open_session(41 virtual std::shared_ptr<Session> open_session(
42 std::string const& name, std::shared_ptr<EventSink> const& sink) = 0;42 std::string const& name, std::shared_ptr<EventSink> const& sink) = 0;
@@ -44,7 +44,7 @@
4444
45 virtual SurfaceId create_surface_for(std::shared_ptr<Session> const& session,45 virtual SurfaceId create_surface_for(std::shared_ptr<Session> const& session,
46 shell::SurfaceCreationParameters const& params) = 0;46 shell::SurfaceCreationParameters const& params) = 0;
47 47
48 virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;48 virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;
4949
50protected:50protected:
5151
=== modified file 'include/server/mir/shell/session_manager.h'
--- include/server/mir/shell/session_manager.h 2013-11-07 23:20:58 +0000
+++ include/server/mir/shell/session_manager.h 2013-11-15 09:55:09 +0000
@@ -29,23 +29,15 @@
2929
30namespace mir30namespace mir
31{31{
32
33namespace frontend
34{
35class EventSink;
36}
37/// Management of sessions and surfaces32/// Management of sessions and surfaces
38namespace shell33namespace shell
39{34{
40class SurfaceFactory;35class SurfaceFactory;
41class SessionContainer;36class SessionContainer;
42class FocusSetter;37class FocusSetter;
43class Session;
44class InputRegistrar;
45class SnapshotStrategy;38class SnapshotStrategy;
46class SessionEventSink;39class SessionEventSink;
47class SessionListener;40class SessionListener;
48struct SurfaceCreationParameters;
4941
50// TODO make private to shell42// TODO make private to shell
51// This first needs unity-mir to be updated to use FocusController43// This first needs unity-mir to be updated to use FocusController
@@ -71,7 +63,7 @@
71 void focus_next();63 void focus_next();
72 std::weak_ptr<Session> focussed_application() const;64 std::weak_ptr<Session> focussed_application() const;
73 void set_focus_to(std::shared_ptr<Session> const& focus);65 void set_focus_to(std::shared_ptr<Session> const& focus);
74 66
75 void handle_surface_created(std::shared_ptr<frontend::Session> const& session);67 void handle_surface_created(std::shared_ptr<frontend::Session> const& session);
7668
77protected:69protected:
7870
=== modified file 'src/server/frontend/CMakeLists.txt'
--- src/server/frontend/CMakeLists.txt 2013-11-04 05:59:29 +0000
+++ src/server/frontend/CMakeLists.txt 2013-11-15 09:55:09 +0000
@@ -8,7 +8,6 @@
8 protobuf_message_processor.cpp8 protobuf_message_processor.cpp
9 protobuf_buffer_packer.cpp9 protobuf_buffer_packer.cpp
10 null_message_processor.cpp10 null_message_processor.cpp
11 global_event_sender.cpp
12 published_socket_connector.cpp11 published_socket_connector.cpp
13 protobuf_session_creator.cpp12 protobuf_session_creator.cpp
14 socket_session.cpp13 socket_session.cpp
1514
=== modified file 'src/server/frontend/default_configuration.cpp'
--- src/server/frontend/default_configuration.cpp 2013-11-04 05:59:29 +0000
+++ src/server/frontend/default_configuration.cpp 2013-11-15 09:55:09 +0000
@@ -19,7 +19,6 @@
19#include "mir/default_server_configuration.h"19#include "mir/default_server_configuration.h"
2020
21#include "resource_cache.h"21#include "resource_cache.h"
22#include "global_event_sender.h"
23#include "protobuf_ipc_factory.h"22#include "protobuf_ipc_factory.h"
24#include "protobuf_session_creator.h"23#include "protobuf_session_creator.h"
25#include "published_socket_connector.h"24#include "published_socket_connector.h"
@@ -27,8 +26,6 @@
27#include "unauthorized_display_changer.h"26#include "unauthorized_display_changer.h"
2827
29#include "mir/options/option.h"28#include "mir/options/option.h"
30#include "mir/shell/session_container.h"
31#include "mir/shell/session.h"
3229
33namespace mf = mir::frontend;30namespace mf = mir::frontend;
34namespace mg = mir::graphics;31namespace mg = mir::graphics;
@@ -121,21 +118,15 @@
121 {118 {
122 auto const threads = the_options()->get(frontend_threads,119 auto const threads = the_options()->get(frontend_threads,
123 default_ipc_threads);120 default_ipc_threads);
124 auto shell_sessions = the_shell_session_container();121
125 auto const& force_requests_to_complete = [shell_sessions]122 auto const& force_threads_to_unblock = force_threads_to_unblock_callback();
126 {
127 shell_sessions->for_each([](std::shared_ptr<msh::Session> const& session)
128 {
129 session->force_requests_to_complete();
130 });
131 };
132123
133 if (the_options()->is_set(no_server_socket_opt))124 if (the_options()->is_set(no_server_socket_opt))
134 {125 {
135 return std::make_shared<mf::BasicConnector>(126 return std::make_shared<mf::BasicConnector>(
136 the_session_creator(),127 the_session_creator(),
137 threads,128 threads,
138 force_requests_to_complete,129 force_threads_to_unblock,
139 the_connector_report());130 the_connector_report());
140 }131 }
141 else132 else
@@ -144,22 +135,12 @@
144 the_socket_file(),135 the_socket_file(),
145 the_session_creator(),136 the_session_creator(),
146 threads,137 threads,
147 force_requests_to_complete,138 force_threads_to_unblock,
148 the_connector_report());139 the_connector_report());
149 }140 }
150 });141 });
151}142}
152143
153std::shared_ptr<mf::EventSink>
154mir::DefaultServerConfiguration::the_global_event_sink()
155{
156 return global_event_sink(
157 [this]()
158 {
159 return std::make_shared<mf::GlobalEventSender>(the_shell_session_container());
160 });
161}
162
163std::shared_ptr<mir::frontend::ProtobufIpcFactory>144std::shared_ptr<mir::frontend::ProtobufIpcFactory>
164mir::DefaultServerConfiguration::the_ipc_factory(145mir::DefaultServerConfiguration::the_ipc_factory(
165 std::shared_ptr<mf::Shell> const& shell,146 std::shared_ptr<mf::Shell> const& shell,
166147
=== modified file 'src/server/frontend/published_socket_connector.cpp'
--- src/server/frontend/published_socket_connector.cpp 2013-10-15 08:53:10 +0000
+++ src/server/frontend/published_socket_connector.cpp 2013-11-15 09:55:09 +0000
@@ -35,9 +35,9 @@
35 const std::string& socket_file,35 const std::string& socket_file,
36 std::shared_ptr<SessionCreator> const& session_creator,36 std::shared_ptr<SessionCreator> const& session_creator,
37 int threads,37 int threads,
38 std::function<void()> const& force_requests_to_complete,38 std::function<void()> const& force_threads_to_unblock,
39 std::shared_ptr<ConnectorReport> const& report)39 std::shared_ptr<ConnectorReport> const& report)
40: BasicConnector(session_creator, threads, force_requests_to_complete, report),40: BasicConnector(session_creator, threads, force_threads_to_unblock, report),
41 socket_file(socket_file),41 socket_file(socket_file),
42 acceptor(io_service, socket_file)42 acceptor(io_service, socket_file)
43{43{
@@ -83,11 +83,11 @@
83mf::BasicConnector::BasicConnector(83mf::BasicConnector::BasicConnector(
84 std::shared_ptr<SessionCreator> const& session_creator,84 std::shared_ptr<SessionCreator> const& session_creator,
85 int threads,85 int threads,
86 std::function<void()> const& force_requests_to_complete,86 std::function<void()> const& force_threads_to_unblock,
87 std::shared_ptr<ConnectorReport> const& report)87 std::shared_ptr<ConnectorReport> const& report)
88: report(report),88: report(report),
89 io_service_threads(threads),89 io_service_threads(threads),
90 force_requests_to_complete(force_requests_to_complete),90 force_threads_to_unblock(force_threads_to_unblock),
91 session_creator{session_creator}91 session_creator{session_creator}
92{92{
93}93}
@@ -126,7 +126,7 @@
126 * Ensure that any pending requests will complete (i.e., that they126 * Ensure that any pending requests will complete (i.e., that they
127 * will not block indefinitely waiting for a resource from the server)127 * will not block indefinitely waiting for a resource from the server)
128 */128 */
129 force_requests_to_complete();129 force_threads_to_unblock();
130130
131 report->stopping_threads(io_service_threads.size());131 report->stopping_threads(io_service_threads.size());
132132
133133
=== modified file 'src/server/frontend/published_socket_connector.h'
--- src/server/frontend/published_socket_connector.h 2013-10-15 08:53:10 +0000
+++ src/server/frontend/published_socket_connector.h 2013-11-15 09:55:09 +0000
@@ -50,7 +50,7 @@
50 explicit BasicConnector(50 explicit BasicConnector(
51 std::shared_ptr<SessionCreator> const& session_creator,51 std::shared_ptr<SessionCreator> const& session_creator,
52 int threads,52 int threads,
53 std::function<void()> const& force_requests_to_complete,53 std::function<void()> const& force_threads_to_unblock,
54 std::shared_ptr<ConnectorReport> const& report);54 std::shared_ptr<ConnectorReport> const& report);
55 ~BasicConnector() noexcept;55 ~BasicConnector() noexcept;
56 void start() override;56 void start() override;
@@ -66,7 +66,7 @@
6666
67private:67private:
68 std::vector<std::thread> io_service_threads;68 std::vector<std::thread> io_service_threads;
69 std::function<void()> const force_requests_to_complete;69 std::function<void()> const force_threads_to_unblock;
70 std::shared_ptr<SessionCreator> const session_creator;70 std::shared_ptr<SessionCreator> const session_creator;
71};71};
7272
@@ -78,7 +78,7 @@
78 const std::string& socket_file,78 const std::string& socket_file,
79 std::shared_ptr<SessionCreator> const& session_creator,79 std::shared_ptr<SessionCreator> const& session_creator,
80 int threads,80 int threads,
81 std::function<void()> const& force_requests_to_complete,81 std::function<void()> const& force_threads_to_unblock,
82 std::shared_ptr<ConnectorReport> const& report);82 std::shared_ptr<ConnectorReport> const& report);
83 ~PublishedSocketConnector() noexcept;83 ~PublishedSocketConnector() noexcept;
8484
8585
=== modified file 'src/server/shell/CMakeLists.txt'
--- src/server/shell/CMakeLists.txt 2013-11-08 18:56:58 +0000
+++ src/server/shell/CMakeLists.txt 2013-11-15 09:55:09 +0000
@@ -10,6 +10,7 @@
10 surface_creation_parameters.cpp10 surface_creation_parameters.cpp
11 threaded_snapshot_strategy.cpp11 threaded_snapshot_strategy.cpp
12 gl_pixel_buffer.cpp12 gl_pixel_buffer.cpp
13 global_event_sender.cpp
13 graphics_display_layout.cpp14 graphics_display_layout.cpp
14 mediating_display_changer.cpp15 mediating_display_changer.cpp
15 broadcasting_session_event_sink.cpp16 broadcasting_session_event_sink.cpp
1617
=== modified file 'src/server/shell/default_configuration.cpp'
--- src/server/shell/default_configuration.cpp 2013-11-08 19:03:12 +0000
+++ src/server/shell/default_configuration.cpp 2013-11-15 09:55:09 +0000
@@ -23,11 +23,15 @@
23#include "default_focus_mechanism.h"23#include "default_focus_mechanism.h"
24#include "default_session_container.h"24#include "default_session_container.h"
25#include "gl_pixel_buffer.h"25#include "gl_pixel_buffer.h"
26#include "global_event_sender.h"
26#include "graphics_display_layout.h"27#include "graphics_display_layout.h"
27#include "mediating_display_changer.h"28#include "mediating_display_changer.h"
28#include "organising_surface_factory.h"29#include "organising_surface_factory.h"
30#include "threaded_snapshot_strategy.h"
31
32#include "session_container.h"
29#include "mir/shell/session_manager.h"33#include "mir/shell/session_manager.h"
30#include "threaded_snapshot_strategy.h"34#include "mir/shell/session.h"
3135
32#include "mir/graphics/display.h"36#include "mir/graphics/display.h"
33#include "mir/graphics/gl_context.h"37#include "mir/graphics/gl_context.h"
@@ -187,3 +191,26 @@
187 the_shell_pixel_buffer());191 the_shell_pixel_buffer());
188 });192 });
189}193}
194
195std::function<void()>
196mir::DefaultServerConfiguration::force_threads_to_unblock_callback()
197{
198 auto shell_sessions = the_shell_session_container();
199 return [shell_sessions]
200 {
201 shell_sessions->for_each([](std::shared_ptr<msh::Session> const& session)
202 {
203 session->force_requests_to_complete();
204 });
205 };
206}
207
208std::shared_ptr<mf::EventSink>
209mir::DefaultServerConfiguration::the_global_event_sink()
210{
211 return global_event_sink(
212 [this]()
213 {
214 return std::make_shared<msh::GlobalEventSender>(the_shell_session_container());
215 });
216}
190217
=== modified file 'src/server/shell/default_session_container.cpp'
--- src/server/shell/default_session_container.cpp 2013-11-07 23:20:58 +0000
+++ src/server/shell/default_session_container.cpp 2013-11-15 09:55:09 +0000
@@ -17,7 +17,6 @@
17 */17 */
1818
19#include "default_session_container.h"19#include "default_session_container.h"
20#include "mir/shell/session.h"
2120
22#include <boost/throw_exception.hpp>21#include <boost/throw_exception.hpp>
2322
2423
=== modified file 'src/server/shell/default_session_container.h'
--- src/server/shell/default_session_container.h 2013-11-07 23:20:58 +0000
+++ src/server/shell/default_session_container.h 2013-11-15 09:55:09 +0000
@@ -23,7 +23,7 @@
23#include <memory>23#include <memory>
24#include <mutex>24#include <mutex>
2525
26#include "mir/shell/session_container.h"26#include "session_container.h"
2727
28namespace mir28namespace mir
29{29{
3030
=== renamed file 'src/server/frontend/global_event_sender.cpp' => 'src/server/shell/global_event_sender.cpp'
--- src/server/frontend/global_event_sender.cpp 2013-10-24 14:33:46 +0000
+++ src/server/shell/global_event_sender.cpp 2013-11-15 09:55:09 +0000
@@ -17,29 +17,28 @@
17 */17 */
1818
19#include "global_event_sender.h"19#include "global_event_sender.h"
20#include "mir/shell/session_container.h"20#include "session_container.h"
21#include "mir/shell/session.h"21#include "mir/shell/session.h"
2222
23namespace mf=mir::frontend;
24namespace mg=mir::graphics;23namespace mg=mir::graphics;
25namespace msh=mir::shell;24namespace msh=mir::shell;
2625
27mf::GlobalEventSender::GlobalEventSender(std::shared_ptr<shell::SessionContainer> const& session_container)26msh::GlobalEventSender::GlobalEventSender(std::shared_ptr<SessionContainer> const& session_container)
28 : sessions(session_container)27 : sessions(session_container)
29{28{
30}29}
3130
32void mf::GlobalEventSender::handle_event(MirEvent const&)31void msh::GlobalEventSender::handle_event(MirEvent const&)
33{ 32{
34 //TODO, no driving test cases, although messages like 'server shutdown' could go here33 //TODO, no driving test cases, although messages like 'server shutdown' could go here
35}34}
3635
37void mf::GlobalEventSender::handle_lifecycle_event(MirLifecycleState)36void msh::GlobalEventSender::handle_lifecycle_event(MirLifecycleState)
38{37{
39 // Lifecycle events are per application session, never global38 // Lifecycle events are per application session, never global
40}39}
4140
42void mf::GlobalEventSender::handle_display_config_change(mg::DisplayConfiguration const& config)41void msh::GlobalEventSender::handle_display_config_change(mg::DisplayConfiguration const& config)
43{42{
44 sessions->for_each([&config](std::shared_ptr<msh::Session> const& session)43 sessions->for_each([&config](std::shared_ptr<msh::Session> const& session)
45 {44 {
4645
=== renamed file 'src/server/frontend/global_event_sender.h' => 'src/server/shell/global_event_sender.h'
--- src/server/frontend/global_event_sender.h 2013-10-24 14:33:46 +0000
+++ src/server/shell/global_event_sender.h 2013-11-15 09:55:09 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#ifndef MIR_FRONTEND_GLOBAL_EVENT_SENDER_H_19#ifndef MIR_SHELL_GLOBAL_EVENT_SENDER_H_
20#define MIR_FRONTEND_GLOBAL_EVENT_SENDER_H_20#define MIR_SHELL_GLOBAL_EVENT_SENDER_H_
2121
22#include "mir/frontend/event_sink.h"22#include "mir/frontend/event_sink.h"
23#include <memory>23#include <memory>
@@ -27,22 +27,20 @@
27namespace shell27namespace shell
28{28{
29class SessionContainer;29class SessionContainer;
30}30
31namespace frontend31class GlobalEventSender : public frontend::EventSink
32{
33class GlobalEventSender : public EventSink
34{32{
35public:33public:
36 GlobalEventSender(std::shared_ptr<shell::SessionContainer> const&);34 GlobalEventSender(std::shared_ptr<SessionContainer> const&);
3735
38 void handle_event(MirEvent const& e);36 void handle_event(MirEvent const& e);
39 void handle_lifecycle_event(MirLifecycleState state);37 void handle_lifecycle_event(MirLifecycleState state);
40 void handle_display_config_change(graphics::DisplayConfiguration const& config);38 void handle_display_config_change(graphics::DisplayConfiguration const& config);
4139
42private:40private:
43 std::shared_ptr<shell::SessionContainer> const sessions;41 std::shared_ptr<SessionContainer> const sessions;
44};42};
45}43}
46}44}
4745
48#endif /* MIR_FRONTEND_GLOBAL_EVENT_SENDER_H_ */46#endif /* MIR_SHELL_GLOBAL_EVENT_SENDER_H_ */
4947
=== modified file 'src/server/shell/mediating_display_changer.cpp'
--- src/server/shell/mediating_display_changer.cpp 2013-11-04 05:59:29 +0000
+++ src/server/shell/mediating_display_changer.cpp 2013-11-15 09:55:09 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mediating_display_changer.h"19#include "mediating_display_changer.h"
20#include "mir/shell/session_container.h"20#include "session_container.h"
21#include "mir/shell/session.h"21#include "mir/shell/session.h"
22#include "session_event_handler_register.h"22#include "session_event_handler_register.h"
23#include "mir/graphics/display.h"23#include "mir/graphics/display.h"
2424
=== renamed file 'include/server/mir/shell/session_container.h' => 'src/server/shell/session_container.h'
=== modified file 'src/server/shell/session_manager.cpp'
--- src/server/shell/session_manager.cpp 2013-11-14 13:42:28 +0000
+++ src/server/shell/session_manager.cpp 2013-11-15 09:55:09 +0000
@@ -18,7 +18,7 @@
1818
19#include "mir/shell/session_manager.h"19#include "mir/shell/session_manager.h"
20#include "mir/shell/application_session.h"20#include "mir/shell/application_session.h"
21#include "mir/shell/session_container.h"21#include "session_container.h"
22#include "mir/shell/surface_factory.h"22#include "mir/shell/surface_factory.h"
23#include "mir/shell/focus_setter.h"23#include "mir/shell/focus_setter.h"
24#include "mir/shell/session.h"24#include "mir/shell/session.h"
2525
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2013-11-11 17:07:09 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2013-11-15 09:55:09 +0000
@@ -21,7 +21,7 @@
21#include "mir/shell/placement_strategy.h"21#include "mir/shell/placement_strategy.h"
22#include "mir/shell/surface_factory.h"22#include "mir/shell/surface_factory.h"
23#include "mir/shell/surface.h"23#include "mir/shell/surface.h"
24#include "mir/shell/session_container.h"24#include "src/server/shell/session_container.h"
25#include "mir/shell/session.h"25#include "mir/shell/session.h"
26#include "src/server/surfaces/surface_controller.h"26#include "src/server/surfaces/surface_controller.h"
27#include "src/server/surfaces/surface_stack_model.h"27#include "src/server/surfaces/surface_stack_model.h"
2828
=== modified file 'tests/acceptance-tests/test_display_configuration.cpp'
--- tests/acceptance-tests/test_display_configuration.cpp 2013-11-04 13:39:27 +0000
+++ tests/acceptance-tests/test_display_configuration.cpp 2013-11-15 09:55:09 +0000
@@ -19,7 +19,7 @@
1919
20#include "mir/frontend/session_authorizer.h"20#include "mir/frontend/session_authorizer.h"
21#include "mir/graphics/event_handler_register.h"21#include "mir/graphics/event_handler_register.h"
22#include "src/server/frontend/global_event_sender.h"22#include "src/server/shell/global_event_sender.h"
2323
24#include "mir_test_framework/display_server_test_fixture.h"24#include "mir_test_framework/display_server_test_fixture.h"
25#include "mir_test_framework/cross_process_sync.h"25#include "mir_test_framework/cross_process_sync.h"
2626
=== modified file 'tests/acceptance-tests/test_focus_selection.cpp'
--- tests/acceptance-tests/test_focus_selection.cpp 2013-11-12 02:30:22 +0000
+++ tests/acceptance-tests/test_focus_selection.cpp 2013-11-15 09:55:09 +0000
@@ -18,7 +18,7 @@
1818
19#include "mir_toolkit/mir_client_library.h"19#include "mir_toolkit/mir_client_library.h"
2020
21#include "mir/shell/session_container.h"21#include "src/server/shell/session_container.h"
22#include "src/server/shell/consuming_placement_strategy.h"22#include "src/server/shell/consuming_placement_strategy.h"
23#include "src/server/shell/organising_surface_factory.h"23#include "src/server/shell/organising_surface_factory.h"
24#include "mir/shell/session_manager.h"24#include "mir/shell/session_manager.h"
2525
=== modified file 'tests/integration-tests/test_display_info.cpp'
--- tests/integration-tests/test_display_info.cpp 2013-11-04 13:58:32 +0000
+++ tests/integration-tests/test_display_info.cpp 2013-11-15 09:55:09 +0000
@@ -22,7 +22,6 @@
22#include "src/server/frontend/protobuf_ipc_factory.h"22#include "src/server/frontend/protobuf_ipc_factory.h"
23#include "src/server/frontend/resource_cache.h"23#include "src/server/frontend/resource_cache.h"
24#include "src/server/frontend/session_mediator.h"24#include "src/server/frontend/session_mediator.h"
25#include "src/server/frontend/global_event_sender.h"
2625
27#include "mir_test_framework/display_server_test_fixture.h"26#include "mir_test_framework/display_server_test_fixture.h"
28#include "mir_test_framework/cross_process_sync.h"27#include "mir_test_framework/cross_process_sync.h"
2928
=== modified file 'tests/unit-tests/frontend/CMakeLists.txt'
--- tests/unit-tests/frontend/CMakeLists.txt 2013-11-04 05:59:29 +0000
+++ tests/unit-tests/frontend/CMakeLists.txt 2013-11-15 09:55:09 +0000
@@ -9,7 +9,6 @@
9 ${CMAKE_CURRENT_SOURCE_DIR}/test_session_mediator.cpp9 ${CMAKE_CURRENT_SOURCE_DIR}/test_session_mediator.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/test_socket_session.cpp10 ${CMAKE_CURRENT_SOURCE_DIR}/test_socket_session.cpp
11 ${CMAKE_CURRENT_SOURCE_DIR}/test_event_sender.cpp11 ${CMAKE_CURRENT_SOURCE_DIR}/test_event_sender.cpp
12 ${CMAKE_CURRENT_SOURCE_DIR}/test_global_event_sender.cpp
13 ${CMAKE_CURRENT_SOURCE_DIR}/test_unauthorized_display_changer.cpp12 ${CMAKE_CURRENT_SOURCE_DIR}/test_unauthorized_display_changer.cpp
14)13)
1514
1615
=== modified file 'tests/unit-tests/shell/CMakeLists.txt'
--- tests/unit-tests/shell/CMakeLists.txt 2013-11-08 18:56:58 +0000
+++ tests/unit-tests/shell/CMakeLists.txt 2013-11-15 09:55:09 +0000
@@ -7,6 +7,7 @@
7 ${CMAKE_CURRENT_SOURCE_DIR}/test_organising_surface_factory.cpp7 ${CMAKE_CURRENT_SOURCE_DIR}/test_organising_surface_factory.cpp
8 ${CMAKE_CURRENT_SOURCE_DIR}/test_threaded_snapshot_strategy.cpp8 ${CMAKE_CURRENT_SOURCE_DIR}/test_threaded_snapshot_strategy.cpp
9 ${CMAKE_CURRENT_SOURCE_DIR}/test_gl_pixel_buffer.cpp9 ${CMAKE_CURRENT_SOURCE_DIR}/test_gl_pixel_buffer.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/test_global_event_sender.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/test_graphics_display_layout.cpp11 ${CMAKE_CURRENT_SOURCE_DIR}/test_graphics_display_layout.cpp
11 ${CMAKE_CURRENT_SOURCE_DIR}/test_broadcasting_session_event_sink.cpp12 ${CMAKE_CURRENT_SOURCE_DIR}/test_broadcasting_session_event_sink.cpp
12)13)
1314
=== renamed file 'tests/unit-tests/frontend/test_global_event_sender.cpp' => 'tests/unit-tests/shell/test_global_event_sender.cpp'
--- tests/unit-tests/frontend/test_global_event_sender.cpp 2013-11-07 23:20:58 +0000
+++ tests/unit-tests/shell/test_global_event_sender.cpp 2013-11-15 09:55:09 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#include "src/server/frontend/global_event_sender.h"19#include "src/server/shell/global_event_sender.h"
20#include "mir/shell/session_container.h"20#include "src/server/shell/session_container.h"
21#include "mir_test_doubles/mock_frontend_surface.h"21#include "mir_test_doubles/mock_frontend_surface.h"
22#include "mir_test_doubles/mock_shell_session.h"22#include "mir_test_doubles/mock_shell_session.h"
23#include "mir_test_doubles/stub_display_configuration.h"23#include "mir_test_doubles/stub_display_configuration.h"
@@ -29,7 +29,6 @@
29namespace mt=mir::test;29namespace mt=mir::test;
30namespace mtd=mir::test::doubles;30namespace mtd=mir::test::doubles;
31namespace msh=mir::shell;31namespace msh=mir::shell;
32namespace mf=mir::frontend;
3332
34namespace33namespace
35{34{
@@ -55,7 +54,7 @@
55 .Times(1)54 .Times(1)
56 .WillOnce(SaveArg<0>(&called_fn)); 55 .WillOnce(SaveArg<0>(&called_fn));
5756
58 mf::GlobalEventSender g_sender(mt::fake_shared(mock_storage));57 msh::GlobalEventSender g_sender(mt::fake_shared(mock_storage));
5958
60 mtd::StubDisplayConfig stub_display_config;59 mtd::StubDisplayConfig stub_display_config;
61 g_sender.handle_display_config_change(stub_display_config);60 g_sender.handle_display_config_change(stub_display_config);
6261
=== modified file 'tests/unit-tests/shell/test_mediating_display_changer.cpp'
--- tests/unit-tests/shell/test_mediating_display_changer.cpp 2013-11-04 05:59:29 +0000
+++ tests/unit-tests/shell/test_mediating_display_changer.cpp 2013-11-15 09:55:09 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "src/server/shell/mediating_display_changer.h"19#include "src/server/shell/mediating_display_changer.h"
20#include "mir/shell/session_container.h"20#include "src/server/shell/session_container.h"
21#include "mir/graphics/display_configuration_policy.h"21#include "mir/graphics/display_configuration_policy.h"
22#include "src/server/shell/broadcasting_session_event_sink.h"22#include "src/server/shell/broadcasting_session_event_sink.h"
2323

Subscribers

People subscribed via source and target branches