Merge lp:~gerboland/qtmir/enable-applauncherd into lp:qtmir

Proposed by Zoltan Balogh
Status: Work in progress
Proposed branch: lp:~gerboland/qtmir/enable-applauncherd
Merge into: lp:qtmir
Diff against target: 179 lines (+62/-4)
5 files modified
debian/changelog (+6/-0)
src/modules/Unity/Application/application_manager.cpp (+8/-0)
src/modules/Unity/Application/application_manager.h (+3/-0)
src/modules/Unity/Application/sessionmanager.cpp (+39/-4)
src/modules/Unity/Application/sessionmanager.h (+6/-0)
To merge this branch: bzr merge lp:~gerboland/qtmir/enable-applauncherd
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Mir development team Pending
Review via email: mp+270206@code.launchpad.net

Commit message

Test it with applauncher

Description of the change

Test it with applauncher - NOT GOOD ENOUGH TO LAND! (Greyback)

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

Merge trunk

372. By Gerry Boland

Solve race where new booster session created before old booster instance has created surface

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
373. By Gerry Boland

Merge ~zeller-benjamin/qtmir/applauncherd

374. By Gerry Boland

Merge trunk

375. By Gerry Boland

Cleanup debug, typo and indent

376. By Gerry Boland

Merge use-pid_t

377. By Gerry Boland

Use pid_t for booster

378. By Gerry Boland

Merge use-pid_t again

379. By Gerry Boland

Merge trunk

380. By Gerry Boland

Merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:380
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-1-ci/11/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:380
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/131/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1115
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1115
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1115
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1113/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1113/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1113/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1113/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1113/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1113/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

This isn't going anywhere any time soon, marking WIP

Unmerged revisions

380. By Gerry Boland

Merge trunk

379. By Gerry Boland

Merge trunk

378. By Gerry Boland

Merge use-pid_t again

377. By Gerry Boland

Use pid_t for booster

376. By Gerry Boland

Merge use-pid_t

375. By Gerry Boland

Cleanup debug, typo and indent

374. By Gerry Boland

Merge trunk

373. By Gerry Boland

Merge ~zeller-benjamin/qtmir/applauncherd

372. By Gerry Boland

Solve race where new booster session created before old booster instance has created surface

371. By Gerry Boland

Merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-12-10 13:08:47 +0000
3+++ debian/changelog 2015-12-16 17:10:30 +0000
4@@ -19,6 +19,12 @@
5
6 -- Gerry Boland <ci-train-bot@canonical.com> Thu, 10 Dec 2015 13:08:47 +0000
7
8+qtmir (0.4.6+156.10.20151455-0ubuntu3) vivid; urgency=medium
9+
10+ * Applauncherd
11+
12+ -- Benjamin Zeller <benjamin.zeller@canonical.com> Wed, 23 Sep 2015 19:42:39 +0200
13+
14 qtmir (0.4.6+16.04.20151125-0ubuntu2) xenial; urgency=medium
15
16 * Rebuild against Qt 5.5.1.
17
18=== modified file 'src/modules/Unity/Application/application_manager.cpp'
19--- src/modules/Unity/Application/application_manager.cpp 2015-12-07 12:23:29 +0000
20+++ src/modules/Unity/Application/application_manager.cpp 2015-12-16 17:10:30 +0000
21@@ -190,6 +190,7 @@
22 , m_procInfo(procInfo)
23 , m_sharedWakelock(sharedWakelock)
24 , m_settings(settings)
25+ , m_boosterPid(0)
26 {
27 qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::ApplicationManager (this=%p)" << this;
28 setObjectName("qtmir::ApplicationManager");
29@@ -591,6 +592,13 @@
30 return;
31 }
32
33+
34+ if (info->startsWith("/usr/bin/booster-ubuntu-components")) {
35+ authorized = true;
36+ m_boosterPid = pid;
37+ return;
38+ }
39+
40 const QString desktopFileName = info->getParameter("--desktop_file_hint=");
41
42 if (desktopFileName.isNull()) {
43
44=== modified file 'src/modules/Unity/Application/application_manager.h'
45--- src/modules/Unity/Application/application_manager.h 2015-12-07 12:23:29 +0000
46+++ src/modules/Unity/Application/application_manager.h 2015-12-16 17:10:30 +0000
47@@ -114,6 +114,8 @@
48 const QList<Application*> &list() const { return m_applications; }
49 qtmir::Application* findApplicationWithPid(const pid_t pid);
50
51+ pid_t boosterPid() const { return m_boosterPid; }
52+
53 public Q_SLOTS:
54 void authorizeSession(const pid_t pid, bool &authorized);
55
56@@ -161,6 +163,7 @@
57 QSharedPointer<ProcInfo> m_procInfo;
58 QSharedPointer<SharedWakelock> m_sharedWakelock;
59 QSharedPointer<SettingsInterface> m_settings;
60+ pid_t m_boosterPid;
61 QList<Application*> m_closingApplications;
62 QList<QString> m_queuedStartApplications;
63 static ApplicationManager* the_application_manager;
64
65=== modified file 'src/modules/Unity/Application/sessionmanager.cpp'
66--- src/modules/Unity/Application/sessionmanager.cpp 2015-08-11 12:08:32 +0000
67+++ src/modules/Unity/Application/sessionmanager.cpp 2015-12-16 17:10:30 +0000
68@@ -48,6 +48,8 @@
69 manager, &SessionManager::onSessionStarting);
70 QObject::connect(listener, &SessionListener::sessionStopping,
71 manager, &SessionManager::onSessionStopping);
72+ QObject::connect(listener, &SessionListener::sessionCreatedSurface,
73+ manager, &SessionManager::onSessionCreatedSurface);
74 }
75
76 void connectToPromptSessionListener(SessionManager * manager, PromptSessionListener * listener)
77@@ -115,15 +117,21 @@
78
79 void SessionManager::onSessionStarting(std::shared_ptr<mir::scene::Session> const& session)
80 {
81- qCDebug(QTMIR_SESSIONS) << "SessionManager::onSessionStarting - sessionName=" << session->name().c_str();
82+ qCDebug(QTMIR_SESSIONS) << "SessionManager::onSessionStarting - session=" << session.get();
83
84 Session* qmlSession = new Session(session,
85 m_mirServer->the_prompt_session_manager());
86 insert(0, qmlSession);
87
88- Application* application = m_applicationManager->findApplicationWithSession(session);
89- if (application && application->state() != Application::Running) {
90- application->setSession(qmlSession);
91+ // if Booster session, manage separately as it will later spawn a real application session.
92+ if (session->process_id() == m_applicationManager->boosterPid()) {
93+ qCDebug(QTMIR_SESSIONS) << "Found AppLauncherD session=" << qmlSession << "with pid" << session->process_id();
94+ m_boosterSessions.append(qmlSession);
95+ } else {
96+ Application* application = m_applicationManager->findApplicationWithSession(session);
97+ if (application && application->state() != Application::Running) {
98+ application->setSession(qmlSession);
99+ }
100 }
101 // need to remove if we've destroyed outside
102 connect(qmlSession, &Session::destroyed, this, [&](QObject *item) {
103@@ -134,6 +142,32 @@
104 Q_EMIT sessionStarting(qmlSession);
105 }
106
107+void SessionManager::onSessionCreatedSurface(const mir::scene::Session *mirSession,
108+ const std::shared_ptr<mir::scene::Surface> &/*surface*/,
109+ const std::shared_ptr<SurfaceObserver> &/*observer*/)
110+{
111+ qCDebug(QTMIR_SESSIONS) << "SessionManager::onSessionCreatedSurface - session=" << mirSession;
112+
113+ // This is only relevant for the case when the MAppLauncherD booster daemon launches the app.
114+ // In that case, the booster creates a new Session before any app may start, and then passes
115+ // that Session to the app when it starts. The only way AppMan can determine that is when
116+ // the Session belonging to the booster daemon creates a surface.
117+ SessionInterface* qmlSession = findSession(mirSession);
118+ if (!qmlSession) return;
119+
120+ if (m_boosterSessions.contains(qmlSession)) {
121+ m_boosterSessions.removeAll(qmlSession);
122+ // Session has been passed from Booster to the actual App. So must update App/Session association
123+ // This is a bit of a guess - we've no reliable data to figure out the app. So look for a Starting app
124+ Q_FOREACH(Application *application, m_applicationManager->list()) {
125+ if (application->state() == Application::Starting) {
126+ application->setSession(qmlSession);
127+ break;
128+ }
129+ }
130+ }
131+}
132+
133 void SessionManager::onSessionStopping(std::shared_ptr<mir::scene::Session> const& session)
134 {
135 qCDebug(QTMIR_SESSIONS) << "SessionManager::onSessionStopping - sessionName=" << session->name().c_str();
136@@ -141,6 +175,7 @@
137 SessionInterface* qmlSession = findSession(session.get());
138 if (!qmlSession) return;
139
140+ m_boosterSessions.removeAll(qmlSession);
141 remove(qmlSession);
142
143 qmlSession->setLive(false);
144
145=== modified file 'src/modules/Unity/Application/sessionmanager.h'
146--- src/modules/Unity/Application/sessionmanager.h 2015-08-11 12:08:32 +0000
147+++ src/modules/Unity/Application/sessionmanager.h 2015-12-16 17:10:30 +0000
148@@ -34,11 +34,13 @@
149 namespace mir {
150 namespace scene {
151 class Session;
152+ class Surface;
153 class PromptSession;
154 }
155 }
156
157 class MirServer;
158+class SurfaceObserver;
159
160 namespace qtmir {
161
162@@ -68,6 +70,9 @@
163 public Q_SLOTS:
164 void onSessionStarting(std::shared_ptr<mir::scene::Session> const& session);
165 void onSessionStopping(std::shared_ptr<mir::scene::Session> const& session);
166+ void onSessionCreatedSurface(const mir::scene::Session *mirSession,
167+ const std::shared_ptr<mir::scene::Surface> &surface,
168+ const std::shared_ptr<SurfaceObserver> &observer);
169
170 void onPromptSessionStarting(const std::shared_ptr<mir::scene::PromptSession>& promptSession);
171 void onPromptSessionStopping(const std::shared_ptr<mir::scene::PromptSession>& promptSession);
172@@ -79,6 +84,7 @@
173 private:
174 QSharedPointer<MirServer> m_mirServer;
175 ApplicationManager* m_applicationManager;
176+ QVector<SessionInterface*> m_boosterSessions;
177 static SessionManager *the_session_manager;
178
179 QList<Session*> m_sessions;

Subscribers

People subscribed via source and target branches