Merge lp:~alan-griffiths/mir/MVC-refactor-msh-Shell-hierarchy into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Robert Carr on 2015-02-03 |
| Approved revision: | 2296 |
| Merged at revision: | 2284 |
| Proposed branch: | lp:~alan-griffiths/mir/MVC-refactor-msh-Shell-hierarchy |
| Merge into: | lp:mir |
| Diff against target: |
2334 lines (+681/-608) 31 files modified
examples/server_example_window_management.cpp (+1/-0) include/server/mir/server.h (+14/-1) include/server/mir/shell/abstract_shell.h (+116/-0) include/server/mir/shell/shell.h (+2/-22) include/server/mir/shell/shell_wrapper.h (+2/-3) server-ABI-sha1sums (+4/-3) src/server/scene/basic_surface.cpp (+2/-9) src/server/scene/basic_surface.h (+0/-4) src/server/scene/default_configuration.cpp (+0/-1) src/server/scene/surface_allocator.cpp (+0/-3) src/server/scene/surface_allocator.h (+0/-2) src/server/server.cpp (+2/-0) src/server/shell/CMakeLists.txt (+1/-0) src/server/shell/abstract_shell.cpp (+197/-0) src/server/shell/default_configuration.cpp (+2/-1) src/server/shell/default_shell.cpp (+21/-134) src/server/shell/default_shell.h (+9/-45) src/server/shell/frontend_shell.cpp (+4/-2) src/server/shell/shell_wrapper.cpp (+4/-5) src/server/symbols.map (+243/-263) tests/include/mir_test_doubles/mock_surface.h (+0/-1) tests/integration-tests/surface_composition.cpp (+0/-6) tests/integration-tests/test_default_shell.cpp (+51/-2) tests/integration-tests/test_surface_stack_with_compositor.cpp (+0/-2) tests/unit-tests/examples/test_demo_compositor.cpp (+0/-2) tests/unit-tests/scene/test_basic_surface.cpp (+2/-49) tests/unit-tests/scene/test_default_shell.cpp (+3/-1) tests/unit-tests/scene/test_session_manager.cpp (+0/-3) tests/unit-tests/scene/test_surface.cpp (+0/-4) tests/unit-tests/scene/test_surface_impl.cpp (+1/-30) tests/unit-tests/scene/test_surface_stack.cpp (+0/-10) |
| To merge this branch: | bzr merge lp:~alan-griffiths/mir/MVC-refactor-msh-Shell-hierarchy |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Kevin DuBois (community) | Approve on 2015-02-02 | ||
| Robert Carr (community) | Approve on 2015-02-02 | ||
| Chris Halse Rogers | 2015-01-29 | Abstain on 2015-02-02 | |
| PS Jenkins bot | continuous-integration | Approve on 2015-01-30 | |
| Alexandros Frantzis (community) | Approve on 2015-01-30 | ||
|
Review via email:
|
|||
Commit Message
shell: refactor Shell hierarchy
This gives the classes a clearer role:
AbstractShell - this is a policy-less implementation of the Shell interface
DefaultShell - this adds window management policies to the AbstractShell (mostly by overriding methods to add pre- or post-processing). This is still configurable by established strategy classes (placement_strategy and surface_
Description of the Change
shell: refactor Shell hierarchy
This gives the classes a clearer role:
AbstractShell - this is a policy-less implementation of the Shell interface
DefaultShell - this adds window management policies to the AbstractShell (mostly by overriding methods to add pre- or post-processing). This is still configurable by established strategy classes (placement_strategy and surface_
Note:
These changes are driven by:
1. a desire to put all the window management together
2. experience spiking "compatibility branches" to USC and qtmir
| Chris Halse Rogers (raof) wrote : | # |
So, I'm confused as to why we want a policy-less implementation of the Shell interface at all?
If the idea is to share common implementation then wouldn't a separate helper class that shell implementations can use be a more appropriate mechanism?
| Alan Griffiths (alan-griffiths) wrote : | # |
> So, I'm confused as to why we want a policy-less implementation of the Shell
> interface at all?
>
> If the idea is to share common implementation then wouldn't a separate helper
> class that shell implementations can use be a more appropriate mechanism?
I think we agree that it is a good idea to remove remove everything that isn't "policy" from DefaultShell and put all the policy there? The question them becomes one of how to do that without spurious restrictions on the policies that can be implemented through the public interface.
Having a separate helper class would mean that a shell implementor would need to forward or re-implement functions for which they don't wish to apply policy - either way leading to significant "boiler plate".
Ignoring for a moment the deficiencies of the programming language I think the ideal mechanism would be something AOP - where we provide a policy-less shell and the the policy is implemented with decorations like "on_entering(
Traditionally, C++ code has used "override and call the base method" to provide this sort of decoration and I feel it is a suitable solution here.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2289
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Alexandros Frantzis (afrantzis) wrote : | # |
A slight concern:
133 + virtual void setting_
134 + virtual void setting_
Unless one looks at the AbstractShell implementation, it's not apparent that these are called under lock. This may come as a surprise to shell writers and could lead to code with deadlocks. It would be good to document the caveats of overriding these functions.
Looks good otherwise.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2291
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2292
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2296
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Chris Halse Rogers (raof) wrote : | # |
> Having a separate helper class would mean that a shell implementor would need
> to forward or re-implement functions for which they don't wish to apply policy
> - either way leading to significant "boiler plate".
I feel that, in this case, override-
You've done more work on the downstreams, so you've got a better idea of this, so I won't block.
(It vaguely looks like there might be two different worthwhile interfaces merged into Shell, but that's somewhat of a different thingy)
| Alan Griffiths (alan-griffiths) wrote : | # |
> I feel that, in this case, override-
> boiler plate, but with the added downside that the compiler doesn't warn you
> when you've failed to correctly call the base method.
This can also happen with a "helper object" as there is no guarantee that the helper method is invoked.
It is a legitimate concern (and one that would be addressed by AOP if we had it in C++).
| Alan Griffiths (alan-griffiths) wrote : | # |
> You've done more work on the downstreams, so you've got a better idea of this,
> so I won't block.
Here's an example of downstream use:
| Robert Carr (robertcarr) wrote : | # |
w.r.t. Chris's concerns and the abstract shell...I guess I hope this could dissapear
afaics it arises from a combination of two rolls in msh::Shell (preexisting of course)
there is both the factory role and the policy role still.
It seems like AbstractShell provides implementations for the factory roles and allows decoration to implement the policy. If these roles were split AbstractShell impl could dissapear. (e.g. create/
>> + attribute_
This line is making me think that attribute_set is looking weirder and weirder on SurfaceConfigurator and should just be part of the observer system.
| Alan Griffiths (alan-griffiths) wrote : | # |
> >> + attribute_
>
> This line is making me think that attribute_set is looking weirder and weirder
> on SurfaceConfigurator and should just be part of the observer system.
If you look at the dependent branch (which just updates the example) this weird line goes away.
| Alan Griffiths (alan-griffiths) wrote : | # |
> It seems like AbstractShell provides implementations for the factory roles and
> allows decoration to implement the policy. If these roles were split
> AbstractShell impl could dissapear. (e.g. create/
> another interface and surface_
Actually, for generic policy, you need both before_
As I said before:
"I think the ideal mechanism would be something AOP - where we provide a policy-less shell and the the policy is implemented with decorations like "on_entering(
| Kevin DuBois (kdub) wrote : | # |
approve:
I think its a step forward, and the interface looks okay to me. The focus setting code still looks like it has more requirements that the other stuff the shell might want to do, something to clean later.
needs info:
Some of the symbols in the map file seem updated that aren't related to the interface changes (the one that stood out to me was mc::SceneElement). Are all the symbols.map changes hand-picked or autogenerated?
| Alan Griffiths (alan-griffiths) wrote : | # |
> needs info:
> Some of the symbols in the map file seem updated that aren't related to the
> interface changes (the one that stood out to me was mc::SceneElement). Are all
> the symbols.map changes hand-picked or autogenerated?
Yes, there are some overdue updates in the sysmols.map changes. They come from rerunning the script (the hand-crafted stuff is commented at the end of the file).
| Kevin DuBois (kdub) wrote : | # |
Okay, lgtm then, I guess I just picked out a few pre-existing problems in the autogenerated symbols.map

FAILED: Continuous integration, rev:2287 jenkins. qa.ubuntu. com/job/ mir-ci/ 2857/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/1130 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/1129/ console jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/1091 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 854 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 854/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1091 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1091/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/4144 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 17621
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/2857/ rebuild
http://