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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Daniel d'Andrada
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 (community) continuous-integration Approve
Gerry Boland (community) Approve
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.
Revision history for this message
Gerry Boland (gerboland) wrote :

Ah yes, quite right

review: Approve
Revision history for this message
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
=== modified file 'src/platforms/mirserver/windowmanagementpolicy.cpp'
--- src/platforms/mirserver/windowmanagementpolicy.cpp 2017-03-08 13:27:33 +0000
+++ src/platforms/mirserver/windowmanagementpolicy.cpp 2017-03-28 15:52:46 +0000
@@ -44,7 +44,6 @@
44 qtmir::AppNotifier &appNotifier,44 qtmir::AppNotifier &appNotifier,
45 const QSharedPointer<ScreensModel> screensModel)45 const QSharedPointer<ScreensModel> screensModel)
46 : CanonicalWindowManagerPolicy(tools)46 : CanonicalWindowManagerPolicy(tools)
47 , m_tools(tools)
48 , m_windowModel(windowModel)47 , m_windowModel(windowModel)
49 , m_appNotifier(appNotifier)48 , m_appNotifier(appNotifier)
50 , m_eventFeeder(new QtEventFeeder(screensModel))49 , m_eventFeeder(new QtEventFeeder(screensModel))
@@ -84,7 +83,7 @@
8483
85 Q_EMIT m_windowModel.windowReady(windowInfo);84 Q_EMIT m_windowModel.windowReady(windowInfo);
8685
87 auto appInfo = m_tools.info_for(windowInfo.window().application());86 auto appInfo = tools.info_for(windowInfo.window().application());
88 Q_EMIT m_appNotifier.appCreatedWindow(appInfo);87 Q_EMIT m_appNotifier.appCreatedWindow(appInfo);
89}88}
9089
@@ -139,7 +138,7 @@
139{138{
140 // TODO: attach surface observer here139 // TODO: attach surface observer here
141140
142 getExtraInfo(windowInfo)->persistentId = QString::fromStdString(m_tools.id_for_window(windowInfo.window()));141 getExtraInfo(windowInfo)->persistentId = QString::fromStdString(tools.id_for_window(windowInfo.window()));
143142
144 // FIXME: remove when possible143 // FIXME: remove when possible
145 getExtraInfo(windowInfo)->state = toQtState(windowInfo.state());144 getExtraInfo(windowInfo)->state = toQtState(windowInfo.state());
@@ -220,9 +219,9 @@
220219
221void WindowManagementPolicy::ensureWindowIsActive(const miral::Window &window)220void WindowManagementPolicy::ensureWindowIsActive(const miral::Window &window)
222{221{
223 m_tools.invoke_under_lock([&window, this]() {222 tools.invoke_under_lock([&window, this]() {
224 if (m_tools.active_window() != window) {223 if (tools.active_window() != window) {
225 m_tools.select_active_window(window);224 tools.select_active_window(window);
226 }225 }
227 });226 });
228}227}
@@ -263,7 +262,7 @@
263void WindowManagementPolicy::activate(const miral::Window &window)262void WindowManagementPolicy::activate(const miral::Window &window)
264{263{
265 if (window) {264 if (window) {
266 auto &windowInfo = m_tools.info_for(window);265 auto &windowInfo = tools.info_for(window);
267266
268 // restore from minimized if needed267 // restore from minimized if needed
269 if (windowInfo.state() == mir_window_state_minimized) {268 if (windowInfo.state() == mir_window_state_minimized) {
@@ -273,16 +272,16 @@
273 }272 }
274 }273 }
275274
276 m_tools.invoke_under_lock([&]() {275 tools.invoke_under_lock([&]() {
277 m_tools.select_active_window(window);276 tools.select_active_window(window);
278 });277 });
279}278}
280279
281// raises the window tree280// raises the window tree
282void WindowManagementPolicy::raise(const miral::Window &window)281void WindowManagementPolicy::raise(const miral::Window &window)
283{282{
284 m_tools.invoke_under_lock([&window, this]() {283 tools.invoke_under_lock([&window, this]() {
285 m_tools.raise_tree(window);284 tools.raise_tree(window);
286 });285 });
287}286}
288287
@@ -290,9 +289,9 @@
290{289{
291 miral::WindowSpecification modifications;290 miral::WindowSpecification modifications;
292 modifications.size() = size;291 modifications.size() = size;
293 m_tools.invoke_under_lock([&window, &modifications, this]() {292 tools.invoke_under_lock([&window, &modifications, this]() {
294 try {293 try {
295 m_tools.modify_window(m_tools.info_for(window), modifications);294 tools.modify_window(tools.info_for(window), modifications);
296 } catch (const std::out_of_range&) {295 } catch (const std::out_of_range&) {
297 // usually shell trying to operate on a window which already closed, just ignore296 // usually shell trying to operate on a window which already closed, just ignore
298 // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to297 // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to
@@ -306,9 +305,9 @@
306{305{
307 miral::WindowSpecification modifications;306 miral::WindowSpecification modifications;
308 modifications.top_left() = topLeft;307 modifications.top_left() = topLeft;
309 m_tools.invoke_under_lock([&window, &modifications, this]() {308 tools.invoke_under_lock([&window, &modifications, this]() {
310 try {309 try {
311 m_tools.modify_window(m_tools.info_for(window), modifications);310 tools.modify_window(tools.info_for(window), modifications);
312 } catch (const std::out_of_range&) {311 } catch (const std::out_of_range&) {
313 // usually shell trying to operate on a window which already closed, just ignore312 // usually shell trying to operate on a window which already closed, just ignore
314 // TODO: see above comment in resize, same issue313 // TODO: see above comment in resize, same issue
@@ -318,21 +317,21 @@
318317
319void WindowManagementPolicy::ask_client_to_close(const miral::Window &window)318void WindowManagementPolicy::ask_client_to_close(const miral::Window &window)
320{319{
321 m_tools.invoke_under_lock([&window, this]() {320 tools.invoke_under_lock([&window, this]() {
322 m_tools.ask_client_to_close(window);321 tools.ask_client_to_close(window);
323 });322 });
324}323}
325324
326void WindowManagementPolicy::forceClose(const miral::Window &window)325void WindowManagementPolicy::forceClose(const miral::Window &window)
327{326{
328 m_tools.invoke_under_lock([&window, this]() {327 tools.invoke_under_lock([&window, this]() {
329 m_tools.force_close(window);328 tools.force_close(window);
330 });329 });
331}330}
332331
333void WindowManagementPolicy::requestState(const miral::Window &window, const Mir::State state)332void WindowManagementPolicy::requestState(const miral::Window &window, const Mir::State state)
334{333{
335 auto &windowInfo = m_tools.info_for(window);334 auto &windowInfo = tools.info_for(window);
336 auto extraWinInfo = getExtraInfo(windowInfo);335 auto extraWinInfo = getExtraInfo(windowInfo);
337336
338 if (extraWinInfo->state == state)337 if (extraWinInfo->state == state)
@@ -349,8 +348,8 @@
349 if (modifications.state() == windowInfo.state()) {348 if (modifications.state() == windowInfo.state()) {
350 Q_EMIT m_windowModel.windowStateChanged(windowInfo, state);349 Q_EMIT m_windowModel.windowStateChanged(windowInfo, state);
351 } else {350 } else {
352 m_tools.invoke_under_lock([&]() {351 tools.invoke_under_lock([&]() {
353 m_tools.modify_window(windowInfo, modifications);352 tools.modify_window(windowInfo, modifications);
354 });353 });
355 }354 }
356}355}
357356
=== modified file 'src/platforms/mirserver/windowmanagementpolicy.h'
--- src/platforms/mirserver/windowmanagementpolicy.h 2017-02-06 09:10:20 +0000
+++ src/platforms/mirserver/windowmanagementpolicy.h 2017-03-28 15:52:46 +0000
@@ -89,7 +89,6 @@
89private:89private:
90 void ensureWindowIsActive(const miral::Window &window);90 void ensureWindowIsActive(const miral::Window &window);
9191
92 miral::WindowManagerTools m_tools;
93 qtmir::WindowModelNotifier &m_windowModel;92 qtmir::WindowModelNotifier &m_windowModel;
94 qtmir::AppNotifier &m_appNotifier;93 qtmir::AppNotifier &m_appNotifier;
95 const QScopedPointer<QtEventFeeder> m_eventFeeder;94 const QScopedPointer<QtEventFeeder> m_eventFeeder;

Subscribers

People subscribed via source and target branches