Merge lp://staging/~alan-griffiths/qtmir/port-to-msh-Shell into lp://staging/qtmir

Proposed by Alan Griffiths
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 318
Merged at revision: 315
Proposed branch: lp://staging/~alan-griffiths/qtmir/port-to-msh-Shell
Merge into: lp://staging/qtmir
Diff against target: 901 lines (+185/-315)
26 files modified
debian/control (+1/-1)
src/modules/Unity/Application/mirsurfaceitem.cpp (+7/-4)
src/modules/Unity/Application/mirsurfaceitem.h (+3/-0)
src/modules/Unity/Application/mirsurfacemanager.cpp (+9/-7)
src/modules/Unity/Application/mirsurfacemanager.h (+3/-0)
src/modules/Unity/Application/plugin.cpp (+1/-0)
src/modules/Unity/Application/sessionmanager.cpp (+1/-1)
src/platforms/mirserver/CMakeLists.txt (+1/-3)
src/platforms/mirserver/focussetter.cpp (+0/-24)
src/platforms/mirserver/focussetter.h (+0/-28)
src/platforms/mirserver/mirplacementstrategy.cpp (+0/-59)
src/platforms/mirserver/mirplacementstrategy.h (+0/-42)
src/platforms/mirserver/mirserver.cpp (+13/-20)
src/platforms/mirserver/mirserver.h (+4/-3)
src/platforms/mirserver/mirshell.cpp (+75/-0)
src/platforms/mirserver/mirshell.h (+56/-0)
src/platforms/mirserver/nativeinterface.cpp (+2/-2)
src/platforms/mirserver/qteventfeeder.cpp (+2/-2)
src/platforms/mirserver/qteventfeeder.h (+2/-2)
src/platforms/mirserver/surfaceconfigurator.cpp (+0/-34)
src/platforms/mirserver/surfaceconfigurator.h (+0/-41)
tests/modules/MirSurfaceItem/mirsurfaceitem_test.cpp (+1/-1)
tests/modules/common/mock_focus_controller.h (+0/-40)
tests/modules/common/mock_mir_session.h (+1/-0)
tests/modules/common/mock_surface.h (+1/-0)
tests/modules/common/qtmir_test.h (+2/-1)
To merge this branch: bzr merge lp://staging/~alan-griffiths/qtmir/port-to-msh-Shell
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Daniel d'Andrada (community) Abstain
PS Jenkins bot (community) continuous-integration Needs Fixing
Alberto Aguirre (community) Approve
Review via email: mp+247844@code.staging.launchpad.net

Commit message

Port to the msh::Shell API in Mir

Description of the change

Port to the msh::Shell API in Mir

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Needs libmirserver-dev rev bump in debian/control.

Looks good otherwise.

review: Needs Fixing
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

You're gonna hate me, but Qt coding style would impose:
std::shared_ptr<mir::shell::InputTargeter> const& input_targeter
instead of
const std::shared_ptr<mir::shell::InputTargeter> &inputTargeter
i.e.
1. const before type
2. & or * attached to variable name
3. variables using camelCase, not underscore. Only exception are class members which are prefixed with "m_"

Please attach the checklist too: https://wiki.ubuntu.com/Process/Merges/Checklists/QtMir
Is good otherwise

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

> You're gonna hate me, but Qt coding style would impose:
> std::shared_ptr<mir::shell::InputTargeter> const& input_targeter
> instead of
> const std::shared_ptr<mir::shell::InputTargeter> &inputTargeter

I think you've got that the right way around. ;)

But I've changed it.

> i.e.
> 1. const before type
> 2. & or * attached to variable name
> 3. variables using camelCase, not underscore. Only exception are class members
> which are prefixed with "m_"

I note that qtmir is far from consistent in this. E.g.

251 - MirPlacementStrategy(std::shared_ptr<mir::shell::DisplayLayout> const& display_layout);

> Please attach the checklist too:
> https://wiki.ubuntu.com/Process/Merges/Checklists/QtMir

* Did you perform an exploratory manual test run of the code change and any related functionality?

No

 * Did CI run pass? If not, please explain why.

No, changes depend on newer Mir version

> Is good otherwise

Revision history for this message
Gerry Boland (gerboland) wrote :

> > You're gonna hate me, but Qt coding style would impose:
> > std::shared_ptr<mir::shell::InputTargeter> const& input_targeter
> > instead of
> > const std::shared_ptr<mir::shell::InputTargeter> &inputTargeter
>
> I think you've got that the right way around. ;)

D'oh. Thanks!

> But I've changed it.
>
> > i.e.
> > 1. const before type
> > 2. & or * attached to variable name
> > 3. variables using camelCase, not underscore. Only exception are class
> members
> > which are prefixed with "m_"
>
> I note that qtmir is far from consistent in this. E.g.
>
> 251 - MirPlacementStrategy(std::shared_ptr<mir::shell::DisplayLayout>
> const& display_layout);

Indeed, I had a mad notion to use mir style code for mir things, and Qt for Qt things. However now I'm slowly just moving to the Qt style.
Thanks for doing it!

Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yep, tested fine
 * Did CI run pass? If not, please explain why.
Should do, just waiting for it before Top Approve

review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

"""
587 -SurfaceConfigurator::SurfaceConfigurator()
588 -{
589 - qRegisterMetaType<MirSurfaceAttrib>("MirSurfaceAttrib");
590 -}
"""

We need to register MirSurfaceAttrib as a metatype otherwise signal-slot connections that have a parameter or this type will fail.

Please apply this patch to your branch:

""""
=== modified file 'src/modules/Unity/Application/plugin.cpp'
--- src/modules/Unity/Application/plugin.cpp 2014-10-06 11:37:56 +0000
+++ src/modules/Unity/Application/plugin.cpp 2015-02-05 09:30:09 +0000
@@ -78,6 +78,7 @@ class UnityApplicationPlugin : public QQ
         qRegisterMetaType<qtmir::Session*>("Session*");
         qRegisterMetaType<qtmir::SessionInterface*>("SessionInterface*");
         qRegisterMetaType<qtmir::SessionModel*>("SessionModel*");
+ qRegisterMetaType<MirSurfaceAttrib>("MirSurfaceAttrib");

         qmlRegisterUncreatableType<unity::shell::application::ApplicationManagerInterface>(
                     uri, 0, 1, "ApplicationManagerInterface", "Abstract interface. Cannot be created in QML");
""""

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The patch in a more readable way:
http://paste.ubuntu.com/10069953/

318. By Alan Griffiths

update based on dandrader's feedback

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

It's ok now.

review: Abstain
319. By Alan Griffiths

Route surface config changes through shell->set_surface_attribute()

Revision history for this message
Gerry Boland (gerboland) wrote :

+ MirShell *const m_shell;
"const MirShell *m_shell" please

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

> + MirShell *const m_shell;

That's a constant pointer to a (non-constant) MirShell

> "const MirShell *m_shell" please

That's a (non-constant) pointer to a constant MirShell

Do you really want "const (MirShell *)m_shell?

Revision history for this message
Gerry Boland (gerboland) wrote :

You're totally right, objection withdrawn

review: Approve

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