Merge lp:~gerboland/unity-mir/appManV2-compat into lp:unity-mir

Proposed by Gerry Boland
Status: Work in progress
Proposed branch: lp:~gerboland/unity-mir/appManV2-compat
Merge into: lp:unity-mir
Diff against target: 210 lines (+54/-13)
7 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+6/-0)
debian/control (+3/-3)
src/modules/Unity/Application/application.cpp (+8/-1)
src/modules/Unity/Application/application.h (+3/-1)
src/modules/Unity/Application/application_manager.cpp (+21/-0)
src/modules/Unity/Application/application_manager.h (+12/-7)
To merge this branch: bzr merge lp:~gerboland/unity-mir/appManV2-compat
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Needs Information
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+219407@code.launchpad.net

Commit message

Update to use AppManagerV3 API. Bump package version to 1.1.0 to match library version

Description of the change

Update to use AppManagerV3 API

 * Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~gerboland/unity-api/appManVersion2/+merge/219403
https://code.launchpad.net/~gerboland/unity8/appManV2-compat/+merge/219673
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Y

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
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

same here... I thought we were going to get rid of

bool requestFocusApplication(const QString &appId);

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

QtComp will get rid of requestFocusApplication, which is why I removed it from unity-api. But current shell still needs it.

This sequence of MRs is so that we can land the unity-api change separately and sooner, and qtcomp later.

This MR does not change any APIs, just ensures unity-mir builds against the updated unity-api.

Unmerged revisions

229. By Gerry Boland

debian: depend on unity-api version 7.90 or greater

228. By Gerry Boland

debian" bump to 1.1.0 to match library version

227. By Gerry Boland

Restore Application::screenshot and related APIs

226. By Gerry Boland

debian: libubuntu-app-launch2-dev build dependency restored

225. By Gerry Boland

debian package version to 0.5

224. By Gerry Boland

Merge trunk

223. By Gerry Boland

Debian/Control: libunity-mir1 provides unity-application-impl-3

222. By Gerry Boland

Bump library version and increase package version to match it

221. By Gerry Boland

Bump unity-api package dependency version

220. By Gerry Boland

Adopt to AppManV2 API defined in unity-api

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-03-11 03:40:49 +0000
+++ CMakeLists.txt 2014-06-24 23:01:00 +0000
@@ -53,7 +53,7 @@
53include(CTest)53include(CTest)
5454
55set(UNITY_MIR_VERSION_MAJOR 1)55set(UNITY_MIR_VERSION_MAJOR 1)
56set(UNITY_MIR_VERSION_MINOR 0)56set(UNITY_MIR_VERSION_MINOR 1)
57set(UNITY_MIR_VERSION_PATCH 0)57set(UNITY_MIR_VERSION_PATCH 0)
5858
59find_package(PkgConfig REQUIRED)59find_package(PkgConfig REQUIRED)
6060
=== modified file 'debian/changelog'
--- debian/changelog 2014-06-18 19:28:51 +0000
+++ debian/changelog 2014-06-24 23:01:00 +0000
@@ -1,3 +1,9 @@
1unity-mir (1.1.0) UNRELEASED; urgency=medium
2
3 * Update ApplicationManager & Application APIs to match latest unity-api
4
5 -- Gerry Boland <gerry.boland@canonical.com> Thu, 15 May 2014 11:19:54 +0100
6
1unity-mir (0.4+14.10.20140618.1-0ubuntu1) utopic; urgency=low7unity-mir (0.4+14.10.20140618.1-0ubuntu1) utopic; urgency=low
28
3 [ Alberto Aguirre ]9 [ Alberto Aguirre ]
410
=== modified file 'debian/control'
--- debian/control 2014-06-13 16:14:31 +0000
+++ debian/control 2014-06-24 23:01:00 +0000
@@ -9,11 +9,11 @@
9 libboost-dev,9 libboost-dev,
10 libboost-system-dev,10 libboost-system-dev,
11 libubuntu-application-api-dev (>= 2.0.0),11 libubuntu-application-api-dev (>= 2.0.0),
12 libubuntu-app-launch2-dev,
12 libmirserver-dev (>= 0.3.0),13 libmirserver-dev (>= 0.3.0),
13 libmirclient-dev (>= 0.1.9),14 libmirclient-dev (>= 0.1.9),
14 libprocess-cpp-dev,15 libprocess-cpp-dev,
15 libunity-api-dev (>= 7.80.6),16 libunity-api-dev (>= 7.90),
16 libubuntu-app-launch2-dev,
17 qt5-default,17 qt5-default,
18 qtbase5-dev,18 qtbase5-dev,
19 qtdeclarative5-dev,19 qtdeclarative5-dev,
@@ -36,7 +36,7 @@
36Breaks: unity8 (<< 7.86)36Breaks: unity8 (<< 7.86)
37Provides: unity-mir,37Provides: unity-mir,
38 unity-application-impl,38 unity-application-impl,
39 unity-application-impl-2,39 unity-application-impl-3,
40Description: Qt plugins for Unity specific Mir APIs40Description: Qt plugins for Unity specific Mir APIs
41 Unity-Mir provides Qt bindings for Mir features that are not exposed 41 Unity-Mir provides Qt bindings for Mir features that are not exposed
42 through the QtUbuntu QPA plugins but needed for shell functionality.42 through the QtUbuntu QPA plugins but needed for shell functionality.
4343
=== modified file 'src/modules/Unity/Application/application.cpp'
--- src/modules/Unity/Application/application.cpp 2014-05-26 15:54:44 +0000
+++ src/modules/Unity/Application/application.cpp 2014-06-24 23:01:00 +0000
@@ -113,6 +113,12 @@
113 return m_stage;113 return m_stage;
114}114}
115115
116Application::Stages Application::supportedStages() const
117{
118 // FIXME - need to query application for this
119 return Application::MainStage & Application::SideStage;
120}
121
116Application::State Application::state() const122Application::State Application::state() const
117{123{
118 return m_state;124 return m_state;
@@ -182,13 +188,14 @@
182 m_sessionName = name;188 m_sessionName = name;
183}189}
184190
185void Application::setStage(Application::Stage stage)191bool Application::setStage(Application::Stage stage)
186{192{
187 DLOG("Application::setStage (this=%p, stage=%d)", this, static_cast<int>(stage));193 DLOG("Application::setStage (this=%p, stage=%d)", this, static_cast<int>(stage));
188 if (m_stage != stage) {194 if (m_stage != stage) {
189 m_stage = stage;195 m_stage = stage;
190 Q_EMIT stageChanged(stage);196 Q_EMIT stageChanged(stage);
191 }197 }
198 return true;
192}199}
193200
194QImage Application::screenshotImage() const201QImage Application::screenshotImage() const
195202
=== modified file 'src/modules/Unity/Application/application.h'
--- src/modules/Unity/Application/application.h 2014-05-16 15:40:00 +0000
+++ src/modules/Unity/Application/application.h 2014-06-24 23:01:00 +0000
@@ -59,13 +59,14 @@
59 QString comment() const override;59 QString comment() const override;
60 QUrl icon() const override;60 QUrl icon() const override;
61 Stage stage() const override;61 Stage stage() const override;
62 Stages supportedStages() const override;
62 State state() const override;63 State state() const override;
63 bool focused() const override;64 bool focused() const override;
64 QUrl screenshot() const override;65 QUrl screenshot() const override;
6566
66 bool visible() const;67 bool visible() const;
6768
68 void setStage(Stage stage);69 bool setStage(Stage stage);
69 void setVisible(const bool);70 void setVisible(const bool);
7071
71 QImage screenshotImage() const;72 QImage screenshotImage() const;
@@ -88,6 +89,7 @@
8889
89Q_SIGNALS:90Q_SIGNALS:
90 void fullscreenChanged();91 void fullscreenChanged();
92 void screenshotChanged(QUrl uri);
91 void stageChanged(Stage stage);93 void stageChanged(Stage stage);
92 void visibleChanged();94 void visibleChanged();
9395
9496
=== modified file 'src/modules/Unity/Application/application_manager.cpp'
--- src/modules/Unity/Application/application_manager.cpp 2014-05-26 15:54:50 +0000
+++ src/modules/Unity/Application/application_manager.cpp 2014-06-24 23:01:00 +0000
@@ -345,6 +345,16 @@
345 }345 }
346}346}
347347
348bool ApplicationManager::suspendApplication(const QString &appId)
349{
350 Application *app = findApplication(appId);
351 if (app) {
352 return suspendApplication(app);
353 } else {
354 return false;
355 }
356}
357
348bool ApplicationManager::suspendApplication(Application *application)358bool ApplicationManager::suspendApplication(Application *application)
349{359{
350 if (application == nullptr)360 if (application == nullptr)
@@ -363,6 +373,17 @@
363 return true;373 return true;
364}374}
365375
376bool ApplicationManager::resumeApplication(const QString &appId)
377{
378 Application *app = findApplication(appId);
379 if (app) {
380 resumeApplication(app);
381 return true;
382 } else {
383 return false;
384 }
385}
386
366void ApplicationManager::resumeApplication(Application *application)387void ApplicationManager::resumeApplication(Application *application)
367{388{
368 if (application == nullptr)389 if (application == nullptr)
369390
=== modified file 'src/modules/Unity/Application/application_manager.h'
--- src/modules/Unity/Application/application_manager.h 2014-05-26 15:54:44 +0000
+++ src/modules/Unity/Application/application_manager.h 2014-06-24 23:01:00 +0000
@@ -90,17 +90,22 @@
90 void setSuspended(bool suspended);90 void setSuspended(bool suspended);
91 Q_INVOKABLE unitymir::Application* get(int index) const override;91 Q_INVOKABLE unitymir::Application* get(int index) const override;
92 Q_INVOKABLE unitymir::Application* findApplication(const QString &appId) const override;92 Q_INVOKABLE unitymir::Application* findApplication(const QString &appId) const override;
93 Q_INVOKABLE bool requestFocusApplication(const QString &appId) override;93
94 Q_INVOKABLE bool focusApplication(const QString &appId) override;
95 Q_INVOKABLE void unfocusCurrentApplication() override;
96 Q_INVOKABLE unitymir::Application* startApplication(const QString &appId, const QStringList &arguments) override;94 Q_INVOKABLE unitymir::Application* startApplication(const QString &appId, const QStringList &arguments) override;
97 Q_INVOKABLE bool stopApplication(const QString &appId) override;95 Q_INVOKABLE bool stopApplication(const QString &appId) override;
98 Q_INVOKABLE bool updateScreenshot(const QString &appId);96 Q_INVOKABLE bool suspendApplication(const QString &appId) override;
97 Q_INVOKABLE bool resumeApplication(const QString &appId) override;
9998
100 // QAbstractListModel99 // QAbstractListModel
101 int rowCount(const QModelIndex & parent = QModelIndex()) const override;100 int rowCount(const QModelIndex & parent = QModelIndex()) const override;
102 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;101 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
103102
103 Q_INVOKABLE bool requestFocusApplication(const QString &appId);
104 Q_INVOKABLE bool focusApplication(const QString &appId);
105 Q_INVOKABLE void unfocusCurrentApplication();
106
107 Q_INVOKABLE bool updateScreenshot(const QString &appId) override;
108
104 Q_INVOKABLE unitymir::Application *startApplication(const QString &appId, ExecFlags flags,109 Q_INVOKABLE unitymir::Application *startApplication(const QString &appId, ExecFlags flags,
105 const QStringList &arguments = QStringList());110 const QStringList &arguments = QStringList());
106 Q_INVOKABLE void move(int from, int to);111 Q_INVOKABLE void move(int from, int to);
@@ -109,15 +114,13 @@
109 unitymir::Application* findApplicationWithPid(const qint64 pid);114 unitymir::Application* findApplicationWithPid(const qint64 pid);
110115
111 // Internal helpers116 // Internal helpers
112 bool suspendApplication(Application *application);
113 void resumeApplication(Application *application);
114 int panelHeight();117 int panelHeight();
115 QSize displaySize() const { return m_displaySize; }118 QSize displaySize() const { return m_displaySize; }
116119
117public Q_SLOTS:120public Q_SLOTS:
118 void authorizeSession(const quint64 pid, bool &authorized);121 void authorizeSession(const quint64 pid, bool &authorized);
119 void placeSession(::mir::scene::Session const*, uint32_t &x, uint32_t &y);122 void placeSession(::mir::scene::Session const*, uint32_t &x, uint32_t &y);
120 123
121 void onSessionStarting(std::shared_ptr<::mir::scene::Session> const& session);124 void onSessionStarting(std::shared_ptr<::mir::scene::Session> const& session);
122 void onSessionStopping(std::shared_ptr<::mir::scene::Session> const& session);125 void onSessionStopping(std::shared_ptr<::mir::scene::Session> const& session);
123 void onSessionFocused(std::shared_ptr<::mir::scene::Session> const& session);126 void onSessionFocused(std::shared_ptr<::mir::scene::Session> const& session);
@@ -138,6 +141,8 @@
138 void screenshotUpdated();141 void screenshotUpdated();
139142
140private:143private:
144 bool suspendApplication(Application *application);
145 void resumeApplication(Application *application);
141 void setFocused(Application *application);146 void setFocused(Application *application);
142 void add(Application *application);147 void add(Application *application);
143 void remove(Application* application);148 void remove(Application* application);

Subscribers

People subscribed via source and target branches