Merge lp:~alcinnz/slingshot/performance into lp:~elementary-pantheon/slingshot/trunk

Proposed by Adrian Cochrane
Status: Merged
Merged at revision: 760
Proposed branch: lp:~alcinnz/slingshot/performance
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 24 lines (+7/-2)
1 file modified
src/Backend/AppSystem.vala (+7/-2)
To merge this branch: bzr merge lp:~alcinnz/slingshot/performance
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+317739@code.launchpad.net

Description of the change

I wrapped the initial load of the application menu in a thread, so it doesn't held up the rest of Wingpanel.

Given there isn't a mainloop in that new thread the events should be delivered on the main one.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Backend/AppSystem.vala'
2--- src/Backend/AppSystem.vala 2017-02-15 13:14:11 +0000
3+++ src/Backend/AppSystem.vala 2017-02-20 04:25:24 +0000
4@@ -43,7 +43,12 @@
5 apps = new Gee.HashMap<string, Gee.ArrayList<App>> ();
6 categories = new Gee.ArrayList<GMenu.TreeDirectory> ();
7
8- update_app_system ();
9+ // Update app system, and it's underlying GMenu.Tree.load_sync
10+ // Takes a while to run the first time, so wrap in a thread
11+ new Thread<bool> ("menu-loader", () => {
12+ this.update_app_system ();
13+ return true; // We need some return values
14+ });
15 }
16
17 private void update_app_system () {
18@@ -144,4 +149,4 @@
19
20 return sorted_apps;
21 }
22-}
23\ No newline at end of file
24+}

Subscribers

People subscribed via source and target branches