Mir

Code review comment for lp:~cemil-azizoglu/mir/nested_lifecycle_events

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

After our discussions on IRC I thought the intent was to provide a "hook" so that shells implemented using Mir could "hook" into these events and process them. As such I think that HostLifecycleEventListener should be in shell and not in scene.

~~~~

86 + mirnestedscene
...
193 +add_subdirectory(nested/)
...
203 +#include "nested/default_host_lifecycle_event_listener.h"

etc.

This new "scene/nested" library is not justified. All it contains is a default (null) implementation of an interface: scene::HostLifecycleEventListener. I see no reason not to put this in scene directly (or, in view of the above remarks: shell). (That's where you've put mir::DefaultServerConfiguration::the_host_lifecycle_event_listener() anyway).

~~~~

144 + std::static_pointer_cast<void>(host_lifecycle_event_listener).get());

No obvious need for the cast.

~~~~~

+void DefaultHostLifecycleEventListener::lifecycle_event_occured(MirLifecycleState state)
283 +{
284 + app_container->for_each(
285 + [&state](std::shared_ptr<Session> const& session)
286 + {
287 + session->set_lifecycle_state(state);
288 + });
289 +}

I think the default behavior should be to do nothing and let the implementing shell use this as a hook.

review: Needs Fixing

« Back to merge proposal