Mir

Merge lp://staging/~robertcarr/mir/ease-shell-configuration into lp://staging/~mir-team/mir/trunk

Proposed by Robert Carr
Status: Rejected
Rejected by: Robert Carr
Proposed branch: lp://staging/~robertcarr/mir/ease-shell-configuration
Merge into: lp://staging/~mir-team/mir/trunk
Diff against target: 813 lines (+393/-110)
12 files modified
include/server/mir/default_server_configuration.h (+3/-0)
include/server/mir/shell/default_shell_configuration.h (+71/-0)
include/server/mir/shell/session_manager.h (+2/-4)
include/server/mir/shell/shell_configuration.h (+52/-0)
src/server/default_server_configuration.cpp (+14/-14)
src/server/shell/CMakeLists.txt (+1/-0)
src/server/shell/default_shell_configuration.cpp (+82/-0)
src/server/shell/session_manager.cpp (+8/-11)
tests/acceptance-tests/test_focus_selection.cpp (+33/-12)
tests/death-tests/test_application_manager_death.cpp (+25/-5)
tests/integration-tests/shell/test_session_manager.cpp (+47/-31)
tests/unit-tests/shell/test_session_manager.cpp (+55/-33)
To merge this branch: bzr merge lp://staging/~robertcarr/mir/ease-shell-configuration
Reviewer Review Type Date Requested Status
Alan Griffiths Needs Fixing
Daniel van Vugt Abstain
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Needs Fixing
Review via email: mp+157965@code.staging.launchpad.net

Commit message

Encapsulate SessionManager dependencies in a ShellConfiguration object (using the idiom established by input)

Description of the change

I want to write a small demo shell which among other things (largely input filtering), replaces the placement strategy. It's a little cumbersome to do so from the shells perspective though! Also the large number of arguments to SessionManager constructor make refactoring a little painful.

This branch refactors it to use the idiom established by the server configuration and input configuration

To post a comment you must log in.
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 :

I like the intention. Though I don't claim to fully understand the context of all the changes.

This is a common mistake throughout the Mir code. We should probably stop copying and pasting it...
15 + * GNU General Public License for more details.
115 + * GNU General Public License for more details.
220 + * GNU General Public License for more details.
Need "Lesser" as in LGPL.

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

187 + auto configuration = std::make_shared<msh::DefaultShellConfiguration>(the_display(), the_input_focus_selector(),
188 + the_surface_factory());

I think it would make sense to have DefaultServerConfiguration::the_shell_configuration(), since that's the part that users will want to change by overriding.

140 + virtual ~ShellConfiguration() {}

For new base classes/interfaces it is recommended to use "= default()" for the destructor, too, so that we get the noexcept guarantee. The price for this is that we need to explicitly mark destructors of derived classes as noexcept(true).

Some nits:

242 + : view_area(view_area),
243 + input_focus_selector(focus_selector),
244 + underlying_surface_factory(surface_factory)

':' should be indented 4 spaces (we don't use 2 space indentations in any case).

318 + : surface_factory(config->the_surface_factory()),

Likewise.

370 + : DefaultShellConfiguration(view_area, input_selector, surface_factory)

Likewise.

498 + : sequence(mt::fake_shared(container))

Likewise

648 + : session_manager(mt::fake_shared(config))

Likewise.

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

On 11/04/13 15:59, Alexandros Frantzis wrote:
> For new base classes/interfaces it is recommended to use "= default()" for the destructor, too, so that we get the noexcept guarantee. The price for this is that we need to explicitly mark destructors of derived classes as noexcept(true).

Only true for *some* derived classes: Ones with an explicit destructor
definition, or those where there are members with throwing destructors.

--
Alan Griffiths +44 (0)798 9938 758
Octopull Ltd http://www.octopull.co.uk/

Revision history for this message
Robert Carr (robertcarr) wrote :

Thanks both!

Copyright headers fixed (r581)
Add the_shell_configuration() to default server configuration (r582)
Use = default for ~ShellConfiguration (r583)
Fix whitespace (r584)

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

server/*: Need to s/GNU Lesser General/GNU General/g

Stylistically I disagree with a lot of this. Though the sources of all my concerns originate before this proposal and are not really new.

From a high-level perspective, I totally agree that writing a simple dumb shell would be very useful. I was thinking the same. Although I am concerned about the number and complexity of classes we're exposing to shell developers. It feels like too much, but I don't understand them well enough to comment further.

Just need to fix up the licenses for now.

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

> Thanks both!
>
> Copyright headers fixed (r581)
> Add the_shell_configuration() to default server configuration (r582)
> Use = default for ~ShellConfiguration (r583)
> Fix whitespace (r584)

It seems you didn't push the commits :)

580. By Robert Carr

Merge trunk

581. By Robert Carr

Fix copyright headers

582. By Robert Carr

Add the_shell_configuration() to default server configuration

583. By Robert Carr

~ShellConfiguration is noexcept

584. By Robert Carr

Whitespace

Revision history for this message
Robert Carr (robertcarr) wrote :

I know how to use bzr!

585. By Robert Carr

Merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

>> From a high-level perspective, I totally agree that writing a simple dumb shell would be very useful. I was >> thinking the same. Although I am concerned about the number
>> and complexity of classes we're exposing to shell
>> developers. It feels like too much, but I don't understand them well enough to comment further.

I feel this concern! This is part of the idea with getting a little dumb shell going (and some of the other examples), to give us explicit targets to try and improve.

586. By Robert Carr

Trim whitespace

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 :

Still need to remove "Lesser" in src/server/* as in:
37 + * under the terms of the GNU Lesser General Public License version 3,

review: Needs Fixing
Revision history for this message
Robert Carr (robertcarr) wrote :

Fix headers for real!

587. By Robert Carr

Merge trunk

588. By Robert Carr

Fix headers

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

While I think we need to add structure to our configuration process, I'm not convinced that this is is right way forward. (C.f. https://code.launchpad.net/~robertcarr/mir/rebuild-input-focus-selection/+merge/158505/comments/348807)

Lets have a discussion of the pros & cons of different approaches before going too far along any path.

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

OK, licenses are fixed. Though based on Alan's comment I won't do another review just yet.

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

From the email list:

On 16/04/13 22:45, Robert Carr wrote:
> In the case of the shell configuration, the intent was to allow overriding of the session store dependencies constructed in the_session_manager without overriding the entire construction. I felt strange adding many more methods to the already polluted default_server_configuration (the_focus_sequence, the_focus_setter, the_placement_strategy, etc...) so it felt appropriate to build some hierarchy. In this case the dependencies (placement strategy, etc..) live in the same name space and there is no attempt at isolation, only organization.

I can see this approach - the master config having some member config objects with reduced scope. But for this approach to be followed consistently the ShellConfiguration should be held in the DefaultServerConfiguration by a shared_ptr, not a CachedPtr (and it should not strong references to anything that isn't another configuration object.)

review: Needs Fixing

Unmerged revisions

588. By Robert Carr

Fix headers

587. By Robert Carr

Merge trunk

586. By Robert Carr

Trim whitespace

585. By Robert Carr

Merge trunk

584. By Robert Carr

Whitespace

583. By Robert Carr

~ShellConfiguration is noexcept

582. By Robert Carr

Add the_shell_configuration() to default server configuration

581. By Robert Carr

Fix copyright headers

580. By Robert Carr

Merge trunk

579. By Robert Carr

Factor placement strategy out to a default shell configuration method

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches