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
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-03-11 03:40:49 +0000
3+++ CMakeLists.txt 2014-06-24 23:01:00 +0000
4@@ -53,7 +53,7 @@
5 include(CTest)
6
7 set(UNITY_MIR_VERSION_MAJOR 1)
8-set(UNITY_MIR_VERSION_MINOR 0)
9+set(UNITY_MIR_VERSION_MINOR 1)
10 set(UNITY_MIR_VERSION_PATCH 0)
11
12 find_package(PkgConfig REQUIRED)
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2014-06-18 19:28:51 +0000
16+++ debian/changelog 2014-06-24 23:01:00 +0000
17@@ -1,3 +1,9 @@
18+unity-mir (1.1.0) UNRELEASED; urgency=medium
19+
20+ * Update ApplicationManager & Application APIs to match latest unity-api
21+
22+ -- Gerry Boland <gerry.boland@canonical.com> Thu, 15 May 2014 11:19:54 +0100
23+
24 unity-mir (0.4+14.10.20140618.1-0ubuntu1) utopic; urgency=low
25
26 [ Alberto Aguirre ]
27
28=== modified file 'debian/control'
29--- debian/control 2014-06-13 16:14:31 +0000
30+++ debian/control 2014-06-24 23:01:00 +0000
31@@ -9,11 +9,11 @@
32 libboost-dev,
33 libboost-system-dev,
34 libubuntu-application-api-dev (>= 2.0.0),
35+ libubuntu-app-launch2-dev,
36 libmirserver-dev (>= 0.3.0),
37 libmirclient-dev (>= 0.1.9),
38 libprocess-cpp-dev,
39- libunity-api-dev (>= 7.80.6),
40- libubuntu-app-launch2-dev,
41+ libunity-api-dev (>= 7.90),
42 qt5-default,
43 qtbase5-dev,
44 qtdeclarative5-dev,
45@@ -36,7 +36,7 @@
46 Breaks: unity8 (<< 7.86)
47 Provides: unity-mir,
48 unity-application-impl,
49- unity-application-impl-2,
50+ unity-application-impl-3,
51 Description: Qt plugins for Unity specific Mir APIs
52 Unity-Mir provides Qt bindings for Mir features that are not exposed
53 through the QtUbuntu QPA plugins but needed for shell functionality.
54
55=== modified file 'src/modules/Unity/Application/application.cpp'
56--- src/modules/Unity/Application/application.cpp 2014-05-26 15:54:44 +0000
57+++ src/modules/Unity/Application/application.cpp 2014-06-24 23:01:00 +0000
58@@ -113,6 +113,12 @@
59 return m_stage;
60 }
61
62+Application::Stages Application::supportedStages() const
63+{
64+ // FIXME - need to query application for this
65+ return Application::MainStage & Application::SideStage;
66+}
67+
68 Application::State Application::state() const
69 {
70 return m_state;
71@@ -182,13 +188,14 @@
72 m_sessionName = name;
73 }
74
75-void Application::setStage(Application::Stage stage)
76+bool Application::setStage(Application::Stage stage)
77 {
78 DLOG("Application::setStage (this=%p, stage=%d)", this, static_cast<int>(stage));
79 if (m_stage != stage) {
80 m_stage = stage;
81 Q_EMIT stageChanged(stage);
82 }
83+ return true;
84 }
85
86 QImage Application::screenshotImage() const
87
88=== modified file 'src/modules/Unity/Application/application.h'
89--- src/modules/Unity/Application/application.h 2014-05-16 15:40:00 +0000
90+++ src/modules/Unity/Application/application.h 2014-06-24 23:01:00 +0000
91@@ -59,13 +59,14 @@
92 QString comment() const override;
93 QUrl icon() const override;
94 Stage stage() const override;
95+ Stages supportedStages() const override;
96 State state() const override;
97 bool focused() const override;
98 QUrl screenshot() const override;
99
100 bool visible() const;
101
102- void setStage(Stage stage);
103+ bool setStage(Stage stage);
104 void setVisible(const bool);
105
106 QImage screenshotImage() const;
107@@ -88,6 +89,7 @@
108
109 Q_SIGNALS:
110 void fullscreenChanged();
111+ void screenshotChanged(QUrl uri);
112 void stageChanged(Stage stage);
113 void visibleChanged();
114
115
116=== modified file 'src/modules/Unity/Application/application_manager.cpp'
117--- src/modules/Unity/Application/application_manager.cpp 2014-05-26 15:54:50 +0000
118+++ src/modules/Unity/Application/application_manager.cpp 2014-06-24 23:01:00 +0000
119@@ -345,6 +345,16 @@
120 }
121 }
122
123+bool ApplicationManager::suspendApplication(const QString &appId)
124+{
125+ Application *app = findApplication(appId);
126+ if (app) {
127+ return suspendApplication(app);
128+ } else {
129+ return false;
130+ }
131+}
132+
133 bool ApplicationManager::suspendApplication(Application *application)
134 {
135 if (application == nullptr)
136@@ -363,6 +373,17 @@
137 return true;
138 }
139
140+bool ApplicationManager::resumeApplication(const QString &appId)
141+{
142+ Application *app = findApplication(appId);
143+ if (app) {
144+ resumeApplication(app);
145+ return true;
146+ } else {
147+ return false;
148+ }
149+}
150+
151 void ApplicationManager::resumeApplication(Application *application)
152 {
153 if (application == nullptr)
154
155=== modified file 'src/modules/Unity/Application/application_manager.h'
156--- src/modules/Unity/Application/application_manager.h 2014-05-26 15:54:44 +0000
157+++ src/modules/Unity/Application/application_manager.h 2014-06-24 23:01:00 +0000
158@@ -90,17 +90,22 @@
159 void setSuspended(bool suspended);
160 Q_INVOKABLE unitymir::Application* get(int index) const override;
161 Q_INVOKABLE unitymir::Application* findApplication(const QString &appId) const override;
162- Q_INVOKABLE bool requestFocusApplication(const QString &appId) override;
163- Q_INVOKABLE bool focusApplication(const QString &appId) override;
164- Q_INVOKABLE void unfocusCurrentApplication() override;
165+
166 Q_INVOKABLE unitymir::Application* startApplication(const QString &appId, const QStringList &arguments) override;
167 Q_INVOKABLE bool stopApplication(const QString &appId) override;
168- Q_INVOKABLE bool updateScreenshot(const QString &appId);
169+ Q_INVOKABLE bool suspendApplication(const QString &appId) override;
170+ Q_INVOKABLE bool resumeApplication(const QString &appId) override;
171
172 // QAbstractListModel
173 int rowCount(const QModelIndex & parent = QModelIndex()) const override;
174 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
175
176+ Q_INVOKABLE bool requestFocusApplication(const QString &appId);
177+ Q_INVOKABLE bool focusApplication(const QString &appId);
178+ Q_INVOKABLE void unfocusCurrentApplication();
179+
180+ Q_INVOKABLE bool updateScreenshot(const QString &appId) override;
181+
182 Q_INVOKABLE unitymir::Application *startApplication(const QString &appId, ExecFlags flags,
183 const QStringList &arguments = QStringList());
184 Q_INVOKABLE void move(int from, int to);
185@@ -109,15 +114,13 @@
186 unitymir::Application* findApplicationWithPid(const qint64 pid);
187
188 // Internal helpers
189- bool suspendApplication(Application *application);
190- void resumeApplication(Application *application);
191 int panelHeight();
192 QSize displaySize() const { return m_displaySize; }
193
194 public Q_SLOTS:
195 void authorizeSession(const quint64 pid, bool &authorized);
196 void placeSession(::mir::scene::Session const*, uint32_t &x, uint32_t &y);
197-
198+
199 void onSessionStarting(std::shared_ptr<::mir::scene::Session> const& session);
200 void onSessionStopping(std::shared_ptr<::mir::scene::Session> const& session);
201 void onSessionFocused(std::shared_ptr<::mir::scene::Session> const& session);
202@@ -138,6 +141,8 @@
203 void screenshotUpdated();
204
205 private:
206+ bool suspendApplication(Application *application);
207+ void resumeApplication(Application *application);
208 void setFocused(Application *application);
209 void add(Application *application);
210 void remove(Application* application);

Subscribers

People subscribed via source and target branches