Merge lp:~ricmm/qtmir/delay-add-on-dash-start into lp:qtmir

Proposed by Ricardo Mendoza
Status: Work in progress
Proposed branch: lp:~ricmm/qtmir/delay-add-on-dash-start
Merge into: lp:qtmir
Prerequisite: lp:~gerboland/qtmir/lttng
Diff against target: 75 lines (+17/-2)
2 files modified
src/modules/Unity/Application/application_manager.cpp (+14/-2)
src/modules/Unity/Application/application_manager.h (+3/-0)
To merge this branch: bzr merge lp:~ricmm/qtmir/delay-add-on-dash-start
Reviewer Review Type Date Requested Status
Gerry Boland (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+231602@code.launchpad.net

Commit message

Delay adding Application to model when launching app from the Dash via url-dispatcher (for fast exec).

Description of the change

N.B. The same logic is not applied to the startApplication() method because this one is not in a blocking path for UAL's callbacks, therefore adding the Application to the model right away introduces no delays to the final exec()

(Savings are ~200ms)

To post a comment you must log in.
239. By Ricardo Mendoza

Sync

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

There's some merge conflict leftovers in debian/changelog.

For the commit message we use the following format: a short summary (up to 80 or 90 chars) followed by an empty line and then a long description, if any.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> There's some merge conflict leftovers in debian/changelog.

Ah, you're actually removing them. Nevermind
Must be due to the prerequisite...

240. By Ricardo Mendoza

Merge lttng

241. By Ricardo Mendoza

Fix

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
Gerry Boland (gerboland) wrote :

The bad thing about this is that the UI does not respond to a user launching an application *immediately* - now the UI only reacts when the application launches and tries to authorize with Mir. As a result, app launching feels slightly slower.

I'd prefer we call add(application) as soon as possible.

This also does not behave well when a user-launched app fails to start (before authorizing) - the application will remain in m_startingApplications forever.

review: Needs Fixing

Unmerged revisions

241. By Ricardo Mendoza

Fix

240. By Ricardo Mendoza

Merge lttng

239. By Ricardo Mendoza

Sync

238. By Ricardo Mendoza

Delay adding Application to model when in app launch fast-path (launched from Dash by url-dispatcher)

237. By Ricardo Mendoza

Merge lp:~gerboland/qtmir/lttng

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application_manager.cpp'
2--- src/modules/Unity/Application/application_manager.cpp 2014-08-20 18:52:14 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2014-08-20 18:52:14 +0000
4@@ -187,6 +187,10 @@
5 connectToSurfacePlacementStrategy(appManager, placementStrategy);
6 connectToTaskController(appManager, taskController.data());
7
8+ QObject::connect(appManager, &ApplicationManager::addApplication,
9+ appManager, &ApplicationManager::onAddApplication,
10+ Qt::QueuedConnection);
11+
12 return appManager;
13 }
14
15@@ -564,7 +568,7 @@
16 if (application->stage() == Application::SideStage && forceAllAppsIntoMainStage(m_mirConfig))
17 application->setStage(Application::MainStage);
18
19- add(application);
20+ m_startingApplications.append(application);
21 Q_EMIT focusRequested(appId);
22 }
23 else {
24@@ -740,11 +744,13 @@
25
26 qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::authorizeSession - pid=" << pid;
27
28- for (Application *app : m_applications) {
29+ for (Application *app : m_startingApplications) {
30 if (app->state() == Application::Starting) {
31 tracepoint(qtmir, appIdHasProcessId_start);
32 if (m_taskController->appIdHasProcessId(app->appId(), pid)) {
33 app->setPid(pid);
34+ // Use delayed add as this is the fast-path
35+ Q_EMIT addApplication(app);
36 authorized = true;
37 tracepoint(qtmir, appIdHasProcessId_end, 1); //found
38 return;
39@@ -1005,6 +1011,12 @@
40 return m_sideStageApplication;
41 }
42
43+void ApplicationManager::onAddApplication(Application* application)
44+{
45+ add(application);
46+ m_startingApplications.removeOne(application);
47+}
48+
49 void ApplicationManager::add(Application* application)
50 {
51 Q_ASSERT(application != nullptr);
52
53=== modified file 'src/modules/Unity/Application/application_manager.h'
54--- src/modules/Unity/Application/application_manager.h 2014-08-20 18:52:14 +0000
55+++ src/modules/Unity/Application/application_manager.h 2014-08-20 18:52:14 +0000
56@@ -139,9 +139,11 @@
57
58 Q_SIGNALS:
59 void emptyChanged();
60+ void addApplication(Application* application);
61
62 private Q_SLOTS:
63 void screenshotUpdated();
64+ void onAddApplication(Application* application);
65
66 private:
67 void setFocused(Application *application);
68@@ -160,6 +162,7 @@
69 QSharedPointer<MirServerConfiguration> m_mirConfig;
70
71 QList<Application*> m_applications;
72+ QList<Application*> m_startingApplications;
73 Application* m_focusedApplication;
74 Application* m_mainStageApplication;
75 Application* m_sideStageApplication;

Subscribers

People subscribed via source and target branches