Merge lp:~aacid/qtmir/no_m_tools into lp:qtmir

Proposed by Albert Astals Cid on 2017-03-28
Status: Merged
Approved by: Daniel d'Andrada on 2017-03-29
Approved revision: 626
Merged at revision: 636
Proposed branch: lp:~aacid/qtmir/no_m_tools
Merge into: lp:qtmir
Diff against target: 146 lines (+21/-23)
2 files modified
src/platforms/mirserver/windowmanagementpolicy.cpp (+21/-22)
src/platforms/mirserver/windowmanagementpolicy.h (+0/-1)
To merge this branch: bzr merge lp:~aacid/qtmir/no_m_tools
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2017-03-28
Gerry Boland (community) 2017-03-28 Approve on 2017-03-28
Review via email: mp+321192@code.launchpad.net

Commit message

Remove m_tools member

CanonicalWindowManagerPolicy already has a tools, no need to have our own

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

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

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
Gerry Boland (gerboland) wrote :

Ah yes, quite right

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:626
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/641/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4741
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4769
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4591/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/641/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/mirserver/windowmanagementpolicy.cpp'
2--- src/platforms/mirserver/windowmanagementpolicy.cpp 2017-03-08 13:27:33 +0000
3+++ src/platforms/mirserver/windowmanagementpolicy.cpp 2017-03-28 15:52:46 +0000
4@@ -44,7 +44,6 @@
5 qtmir::AppNotifier &appNotifier,
6 const QSharedPointer<ScreensModel> screensModel)
7 : CanonicalWindowManagerPolicy(tools)
8- , m_tools(tools)
9 , m_windowModel(windowModel)
10 , m_appNotifier(appNotifier)
11 , m_eventFeeder(new QtEventFeeder(screensModel))
12@@ -84,7 +83,7 @@
13
14 Q_EMIT m_windowModel.windowReady(windowInfo);
15
16- auto appInfo = m_tools.info_for(windowInfo.window().application());
17+ auto appInfo = tools.info_for(windowInfo.window().application());
18 Q_EMIT m_appNotifier.appCreatedWindow(appInfo);
19 }
20
21@@ -139,7 +138,7 @@
22 {
23 // TODO: attach surface observer here
24
25- getExtraInfo(windowInfo)->persistentId = QString::fromStdString(m_tools.id_for_window(windowInfo.window()));
26+ getExtraInfo(windowInfo)->persistentId = QString::fromStdString(tools.id_for_window(windowInfo.window()));
27
28 // FIXME: remove when possible
29 getExtraInfo(windowInfo)->state = toQtState(windowInfo.state());
30@@ -220,9 +219,9 @@
31
32 void WindowManagementPolicy::ensureWindowIsActive(const miral::Window &window)
33 {
34- m_tools.invoke_under_lock([&window, this]() {
35- if (m_tools.active_window() != window) {
36- m_tools.select_active_window(window);
37+ tools.invoke_under_lock([&window, this]() {
38+ if (tools.active_window() != window) {
39+ tools.select_active_window(window);
40 }
41 });
42 }
43@@ -263,7 +262,7 @@
44 void WindowManagementPolicy::activate(const miral::Window &window)
45 {
46 if (window) {
47- auto &windowInfo = m_tools.info_for(window);
48+ auto &windowInfo = tools.info_for(window);
49
50 // restore from minimized if needed
51 if (windowInfo.state() == mir_window_state_minimized) {
52@@ -273,16 +272,16 @@
53 }
54 }
55
56- m_tools.invoke_under_lock([&]() {
57- m_tools.select_active_window(window);
58+ tools.invoke_under_lock([&]() {
59+ tools.select_active_window(window);
60 });
61 }
62
63 // raises the window tree
64 void WindowManagementPolicy::raise(const miral::Window &window)
65 {
66- m_tools.invoke_under_lock([&window, this]() {
67- m_tools.raise_tree(window);
68+ tools.invoke_under_lock([&window, this]() {
69+ tools.raise_tree(window);
70 });
71 }
72
73@@ -290,9 +289,9 @@
74 {
75 miral::WindowSpecification modifications;
76 modifications.size() = size;
77- m_tools.invoke_under_lock([&window, &modifications, this]() {
78+ tools.invoke_under_lock([&window, &modifications, this]() {
79 try {
80- m_tools.modify_window(m_tools.info_for(window), modifications);
81+ tools.modify_window(tools.info_for(window), modifications);
82 } catch (const std::out_of_range&) {
83 // usually shell trying to operate on a window which already closed, just ignore
84 // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to
85@@ -306,9 +305,9 @@
86 {
87 miral::WindowSpecification modifications;
88 modifications.top_left() = topLeft;
89- m_tools.invoke_under_lock([&window, &modifications, this]() {
90+ tools.invoke_under_lock([&window, &modifications, this]() {
91 try {
92- m_tools.modify_window(m_tools.info_for(window), modifications);
93+ tools.modify_window(tools.info_for(window), modifications);
94 } catch (const std::out_of_range&) {
95 // usually shell trying to operate on a window which already closed, just ignore
96 // TODO: see above comment in resize, same issue
97@@ -318,21 +317,21 @@
98
99 void WindowManagementPolicy::ask_client_to_close(const miral::Window &window)
100 {
101- m_tools.invoke_under_lock([&window, this]() {
102- m_tools.ask_client_to_close(window);
103+ tools.invoke_under_lock([&window, this]() {
104+ tools.ask_client_to_close(window);
105 });
106 }
107
108 void WindowManagementPolicy::forceClose(const miral::Window &window)
109 {
110- m_tools.invoke_under_lock([&window, this]() {
111- m_tools.force_close(window);
112+ tools.invoke_under_lock([&window, this]() {
113+ tools.force_close(window);
114 });
115 }
116
117 void WindowManagementPolicy::requestState(const miral::Window &window, const Mir::State state)
118 {
119- auto &windowInfo = m_tools.info_for(window);
120+ auto &windowInfo = tools.info_for(window);
121 auto extraWinInfo = getExtraInfo(windowInfo);
122
123 if (extraWinInfo->state == state)
124@@ -349,8 +348,8 @@
125 if (modifications.state() == windowInfo.state()) {
126 Q_EMIT m_windowModel.windowStateChanged(windowInfo, state);
127 } else {
128- m_tools.invoke_under_lock([&]() {
129- m_tools.modify_window(windowInfo, modifications);
130+ tools.invoke_under_lock([&]() {
131+ tools.modify_window(windowInfo, modifications);
132 });
133 }
134 }
135
136=== modified file 'src/platforms/mirserver/windowmanagementpolicy.h'
137--- src/platforms/mirserver/windowmanagementpolicy.h 2017-02-06 09:10:20 +0000
138+++ src/platforms/mirserver/windowmanagementpolicy.h 2017-03-28 15:52:46 +0000
139@@ -89,7 +89,6 @@
140 private:
141 void ensureWindowIsActive(const miral::Window &window);
142
143- miral::WindowManagerTools m_tools;
144 qtmir::WindowModelNotifier &m_windowModel;
145 qtmir::AppNotifier &m_appNotifier;
146 const QScopedPointer<QtEventFeeder> m_eventFeeder;

Subscribers

People subscribed via source and target branches