Merge lp:~brandontschaefer/unity/no-launcher-delay-when-dash-opens into lp:unity

Proposed by Brandon Schaefer
Status: Rejected
Rejected by: Marco Trevisan (Treviño)
Proposed branch: lp:~brandontschaefer/unity/no-launcher-delay-when-dash-opens
Merge into: lp:unity
Diff against target: 251 lines (+63/-40)
4 files modified
launcher/Launcher.cpp (+26/-20)
launcher/Launcher.h (+2/-0)
launcher/LauncherController.cpp (+1/-0)
manual-tests/Dash.txt (+34/-20)
To merge this branch: bzr merge lp:~brandontschaefer/unity/no-launcher-delay-when-dash-opens
Reviewer Review Type Date Requested Status
Omer Akram (community) functional Approve
Unity Team Pending
Review via email: mp+123860@code.launchpad.net

Commit message

Show the launcher when the dash is opening with out relaying on ubus.

Description of the change

=== Problem ===
When the launcher is set to auto hide. Then the Dash was opened the launcher would delay in showing at times. This is caused by Ubus by async.

=== Fix ===
Show the launcher as the dash is being open with out doing any ubus calls.

=== Tests ===
Manual tests...

*NOTE* before this gets merged it must be tested on a low-spec machine to confirm it will cause the dash futher problems when opening.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

Doesn't this make opening dash super slow on low-spec machines? The ubus message has idle priority, so launcher redraws will be prioritized and therefore the dash will actually open much later than it does now? (which is already very bad on slow machines)

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Thank you for pointing this out.

As we have talked, the real fix would be getting ubus to have a way to sort out the priority of messages.

If someone has a low spec pc and is able to test this branch out and confirm it makes the dash even worse, then reject this branch.

Revision history for this message
Omer Akram (om26er) wrote :

Tested, this does seem to work fine on a slow machine that I have. I have not noticed any lag in dash opening than there already is.

review: Approve (functional)

Unmerged revisions

2680. By Brandon Schaefer

* The launcher now opens with the dash, instead of relying on UBUS to send the message quick enough.
* Also replaced should with must in the dash manual tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/Launcher.cpp'
2--- launcher/Launcher.cpp 2012-09-04 15:56:50 +0000
3+++ launcher/Launcher.cpp 2012-09-11 23:32:20 +0000
4@@ -1216,30 +1216,36 @@
5
6 if (overlay_monitor == monitor())
7 {
8- if (identity == "dash")
9- {
10- _dash_is_open = true;
11- _hide_machine.SetQuirk(LauncherHideMachine::PLACES_VISIBLE, true);
12- _hover_machine.SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, true);
13- }
14- if (identity == "hud")
15- {
16- _hud_is_open = true;
17- }
18- bg_effect_helper_.enabled = true;
19- // Don't desaturate icons if the mouse is over the launcher:
20- if (!_hovered)
21- {
22- LOG_DEBUG(logger) << "Desaturate on monitor " << monitor();
23- DesaturateIcons();
24- }
25-
26- if (_icon_under_mouse)
27- _icon_under_mouse->HideTooltip();
28+ OverlayIsOpening(identity);
29 }
30 EnsureAnimation();
31 }
32
33+void Launcher::OverlayIsOpening(const std::string& identity)
34+{
35+ if (identity == "dash" && !_dash_is_open)
36+ {
37+ _dash_is_open = true;
38+ _hide_machine.SetQuirk(LauncherHideMachine::PLACES_VISIBLE, true);
39+ _hover_machine.SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, true);
40+ }
41+ else if (identity == "hud")
42+ {
43+ _hud_is_open = true;
44+ }
45+ bg_effect_helper_.enabled = true;
46+
47+ // Don't desaturate icons if the mouse is over the launcher:
48+ if (!_hovered)
49+ {
50+ LOG_DEBUG(logger) << "Desaturate on monitor " << monitor();
51+ DesaturateIcons();
52+ }
53+
54+ if (_icon_under_mouse)
55+ _icon_under_mouse->HideTooltip();
56+}
57+
58 void Launcher::OnOverlayHidden(GVariant* data)
59 {
60 // check the type of overlay
61
62=== modified file 'launcher/Launcher.h'
63--- launcher/Launcher.h 2012-09-01 14:00:19 +0000
64+++ launcher/Launcher.h 2012-09-11 23:32:20 +0000
65@@ -80,6 +80,8 @@
66 void ForceReveal(bool force);
67 void ShowShortcuts(bool show);
68
69+ void OverlayIsOpening(const std::string& identity);
70+
71 void SetModel(LauncherModel::Ptr model);
72 LauncherModel::Ptr GetModel() const;
73
74
75=== modified file 'launcher/LauncherController.cpp'
76--- launcher/LauncherController.cpp 2012-09-04 16:40:30 +0000
77+++ launcher/LauncherController.cpp 2012-09-11 23:32:20 +0000
78@@ -726,6 +726,7 @@
79
80 void Controller::Impl::SendHomeActivationRequest()
81 {
82+ CurrentLauncher()->OverlayIsOpening("dash");
83 ubus.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", dash::NOT_HANDLED, ""));
84 }
85
86
87=== modified file 'manual-tests/Dash.txt'
88--- manual-tests/Dash.txt 2012-08-28 12:23:15 +0000
89+++ manual-tests/Dash.txt 2012-09-11 23:32:20 +0000
90@@ -22,7 +22,7 @@
91 #. Tap the Super key again. Verify the Dash is hidden again.
92
93 Expected Result:
94- The Dash should appear and disappear in response to each tap on the Super
95+ The Dash must appear and disappear in response to each tap on the Super
96 key. Note that a tap is anything faster than 1/4 of a second. Any press
97 that lasts longer than that is not considered a tap.
98
99@@ -55,8 +55,8 @@
100 #. Type an arbitrary search string
101
102 Expected Result:
103- If the search is taking more than ~150ms, a spinner should be animating next
104- to the search bar, once the spinner stops spinning the results shouldn't
105+ If the search is taking more than ~150ms, a spinner must be animating next
106+ to the search bar, once the spinner stops spinning the results must not
107 change.
108
109
110@@ -68,14 +68,14 @@
111
112 Actions:
113 #. Start guest session
114-#. Open the Dash - there shouldn't be any results displayed, since this user
115+#. Open the Dash - there must be any results displayed, since this user
116 account didn't interact with anything yet
117 #. Run an application not present in the launcher (for example gedit)
118 #. Close previously opened application
119
120 Expected Result:
121- When Dash is opened 'gedit' (or application you launched) should be
122- displayed in the "Recent Apps" category. You shouldn't see
123+ When Dash is opened 'gedit' (or application you launched) must be
124+ displayed in the "Recent Apps" category. You must not see
125 "Sorry nothing matches your search" text.
126
127
128@@ -91,7 +91,7 @@
129 * Search for something on your system that returns multiple results (more than the number that can fit in a row)
130 yet all results are in one category only. This differs per system; try searching for "gnome" in the home lens, or "kde"
131 in the app lens.
132- * Multiple results should be returned in both the cases, but if searching for "gnome" on the home lens returns folders in addition to apps
133+ * Multiple results must be returned in both the cases, but if searching for "gnome" on the home lens returns folders in addition to apps
134 or "kde" returns results from two categories in the apps lens, then keep experimenting with other search strings.
135 * When you have at least one situation in which results from only one category are returned, and the number of results are enough to overflow one single row,
136 the test is complete.
137@@ -100,6 +100,20 @@
138 * When a single row of results isn't enough to contain all returned search results, and there are no other category headers, the displayed category
139 header expands automatically
140
141+Launcher opens with the Dash when set to autohide
142+-------------------------------------------------
143+This tests that the Launcher opens with the Dash when set to autohide.
144+
145+Setup:
146+#. Go in CompizConfig Manager and set the Launcher to Autohide.
147+
148+Actions:
149+#. Open the Dash.
150+
151+Expected result:
152+ The Launcher must open with the Dash smoothly. Instead of lazily showing.
153+
154+
155 Filter Results Tests
156 ========================
157 These tests show that the dash "All" button works well.
158@@ -115,7 +129,7 @@
159 #. Open app lens, and the "Filter results" sidebar
160
161 Expected Result:
162- "All" should be selected by default in every filter category.
163+ "All" must be selected by default in every filter category.
164
165 Test "All" Button 2
166 Note: Should be automated
167@@ -129,7 +143,7 @@
168 #. Try to activate it.
169
170 Expected Result:
171- Click on it should do nothing.
172+ Click on it must do nothing.
173
174
175 Test "All" Button 3
176@@ -144,7 +158,7 @@
177 #. Select another item in the filter category.
178
179 Expected Result:
180- The all button should automatically toggle to the un-selected state.
181+ The all button must automatically toggle to the un-selected state.
182
183 Test "All" Button 4
184 Note: Should be automated
185@@ -158,7 +172,7 @@
186 #. Deselect all selected items.
187
188 Expected Result:
189- The all button should automatically toggle to the selected state.
190+ The all button must automatically toggle to the selected state.
191
192 Test Expand/Collapse Filters
193 -------------------------------
194@@ -176,8 +190,8 @@
195 #. Click on the arrow (again).
196
197 Expected Result:
198- When clicking for the first time the filter category should collapse.
199- When clicking for the second time the filter category should expand.
200+ When clicking for the first time the filter category must collapse.
201+ When clicking for the second time the filter category must expand.
202
203
204 Drag and drop tests
205@@ -194,8 +208,8 @@
206
207 Expected Result:
208 As you drag the document-file watch the drag-targets (drop-recepticals) saturate.
209- this saturation-process should be smooth and without flicker.
210- The tinting of the non-drag-targets should not change.
211+ this saturation-process must be smooth and without flicker.
212+ The tinting of the non-drag-targets must not change.
213
214
215 Dash to Launcher document-file drag
216@@ -209,7 +223,7 @@
217 #. Drag any music file into the Firefox icon on the launcher.
218
219 Expected Result:
220- The Dash should close and the music file should open up in Firefox.
221+ The Dash must close and the music file must open up in Firefox.
222
223
224 DnD stacking
225@@ -244,7 +258,7 @@
226 #. Open the dash and search for something (for example "gedit")
227
228 Expected Result:
229- Applications lens should automatically restart and gedit should be visible
230+ Applications lens must automatically restart and gedit must be visible
231 in the results.
232
233
234@@ -261,14 +275,14 @@
235 press the super key and/or show the dash)
236 2. Verify the lensees are not running using the following command:
237 $ ps axf|grep [u]nity-lens
238-Output of this command should be empty
239+Output of this command must be empty
240 3. invoke dash (e.g. by pressing the Super key)
241 4. Verify the lenses were started by using the following command:
242 $ ps axf|grep [u]nity-lens
243
244 Expected Result:
245- Step #2 should produce an empty output.
246- Step #4 should produce something like this:
247+ Step #2 must produce an empty output.
248+ Step #4 must produce something like this:
249 $ ps axf|grep [u]nity-lens
250 2754 ? Sl 0:00 /usr/lib/unity-lens-applications/unity-applications-daemon
251 2756 ? Sl 0:00 /usr/lib/unity-lens-files/unity-files-daemon