Merge lp:~3v1n0/unity/dash-prompt-app-activation into lp:unity
- dash-prompt-app-activation
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Christopher Townsend |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3967 |
Proposed branch: | lp:~3v1n0/unity/dash-prompt-app-activation |
Merge into: | lp:unity |
Diff against target: |
557 lines (+108/-108) 13 files modified
dash/DashController.h (+0/-1) dash/DashView.cpp (+30/-30) dash/DashView.h (+1/-3) dash/ResultView.cpp (+25/-0) dash/ResultView.h (+6/-4) dash/ResultViewGrid.cpp (+16/-13) dash/ScopeView.cpp (+15/-22) hud/HudButton.cpp (+0/-5) hud/HudController.h (+0/-1) launcher/DeviceNotificationDisplayImp.cpp (+0/-1) unity-shared/BGHash.cpp (+5/-2) unity-shared/SearchBar.cpp (+9/-23) unity-shared/SearchBar.h (+1/-3) |
To merge this branch: | bzr merge lp:~3v1n0/unity/dash-prompt-app-activation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Christopher Townsend | Approve | ||
Brandon Schaefer (community) | Approve | ||
Review via email: mp+257205@code.launchpad.net |
Commit message
ResultViewGrid: wait for double-click event only if the relative result needs the Preview
This was causing a 500ms delay between the user click and some results (apps) activation.
Also, at this point, we can get rid of PREVIEW_LEFT_BUTTON activation type.
Description of the change
Remove the annoying delay before launching an application using mouse clicks in dash.
This is a regression we've introduced looong time ago, and really needs to be fixed.
PS Jenkins bot (ps-jenkins) wrote : | # |
Brandon Schaefer (brandontschaefer) wrote : | # |
LGTM
Christopher Townsend (townsend) wrote : | # |
Yeah, very nice! No more 1 second(!) delay when trying to start an app after opening the Dash. I'll wait for Jenkins to ack/nack before top approving.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3964
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3964
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'dash/DashController.h' | |||
2 | --- dash/DashController.h 2014-04-25 02:42:01 +0000 | |||
3 | +++ dash/DashController.h 2015-04-24 13:00:45 +0000 | |||
4 | @@ -21,7 +21,6 @@ | |||
5 | 21 | 21 | ||
6 | 22 | #include <memory> | 22 | #include <memory> |
7 | 23 | 23 | ||
8 | 24 | #include <gdk/gdk.h> | ||
9 | 25 | #include <UnityCore/ConnectionManager.h> | 24 | #include <UnityCore/ConnectionManager.h> |
10 | 26 | #include <UnityCore/GLibDBusServer.h> | 25 | #include <UnityCore/GLibDBusServer.h> |
11 | 27 | #include <UnityCore/GLibSignal.h> | 26 | #include <UnityCore/GLibSignal.h> |
12 | 28 | 27 | ||
13 | === modified file 'dash/DashView.cpp' | |||
14 | --- dash/DashView.cpp 2015-03-20 18:03:15 +0000 | |||
15 | +++ dash/DashView.cpp 2015-04-24 13:00:45 +0000 | |||
16 | @@ -59,7 +59,7 @@ | |||
17 | 59 | const RawPixel PREVIEW_CONTAINER_TRIANGLE_WIDTH = 14_em; | 59 | const RawPixel PREVIEW_CONTAINER_TRIANGLE_WIDTH = 14_em; |
18 | 60 | const RawPixel PREVIEW_CONTAINER_TRIANGLE_HEIGHT = 12_em; | 60 | const RawPixel PREVIEW_CONTAINER_TRIANGLE_HEIGHT = 12_em; |
19 | 61 | 61 | ||
21 | 62 | const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 1000; | 62 | const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 300; |
22 | 63 | } | 63 | } |
23 | 64 | 64 | ||
24 | 65 | // This is so we can access some protected members in nux::VLayout and | 65 | // This is so we can access some protected members in nux::VLayout and |
25 | @@ -120,7 +120,6 @@ | |||
26 | 120 | , preview_displaying_(false) | 120 | , preview_displaying_(false) |
27 | 121 | , preview_navigation_mode_(previews::Navigation::NONE) | 121 | , preview_navigation_mode_(previews::Navigation::NONE) |
28 | 122 | , last_activated_timestamp_(0) | 122 | , last_activated_timestamp_(0) |
29 | 123 | , search_in_progress_(false) | ||
30 | 124 | , activate_on_finish_(false) | 123 | , activate_on_finish_(false) |
31 | 125 | , visible_(false) | 124 | , visible_(false) |
32 | 126 | , opening_column_x_(-1) | 125 | , opening_column_x_(-1) |
33 | @@ -1221,21 +1220,27 @@ | |||
34 | 1221 | 1220 | ||
35 | 1222 | void DashView::OnSearchChanged(std::string const& search_string) | 1221 | void DashView::OnSearchChanged(std::string const& search_string) |
36 | 1223 | { | 1222 | { |
38 | 1224 | search_in_progress_ = true; | 1223 | activate_on_finish_ = false; |
39 | 1225 | } | 1224 | } |
40 | 1226 | 1225 | ||
41 | 1227 | void DashView::OnLiveSearchReached(std::string const& search_string) | 1226 | void DashView::OnLiveSearchReached(std::string const& search_string) |
42 | 1228 | { | 1227 | { |
43 | 1229 | // reset and set it again once we're sure a search is happening | ||
44 | 1230 | search_in_progress_ = false; | ||
45 | 1231 | |||
46 | 1232 | LOG_DEBUG(logger) << "Live search reached: " << search_string; | 1228 | LOG_DEBUG(logger) << "Live search reached: " << search_string; |
48 | 1233 | if (active_scope_view_) | 1229 | if (!active_scope_view_.IsValid()) |
49 | 1230 | return; | ||
50 | 1231 | |||
51 | 1232 | if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished))) | ||
52 | 1234 | { | 1233 | { |
57 | 1235 | if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished))) | 1234 | activate_delay_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] { |
58 | 1236 | { | 1235 | if (activate_on_finish_) |
59 | 1237 | search_in_progress_ = true; | 1236 | { |
60 | 1238 | } | 1237 | activate_on_finish_ = false; |
61 | 1238 | active_scope_view_->ActivateFirst(); | ||
62 | 1239 | } | ||
63 | 1240 | |||
64 | 1241 | activate_delay_.reset(); | ||
65 | 1242 | return false; | ||
66 | 1243 | })); | ||
67 | 1239 | } | 1244 | } |
68 | 1240 | } | 1245 | } |
69 | 1241 | 1246 | ||
70 | @@ -1254,12 +1259,15 @@ | |||
71 | 1254 | LOG_DEBUG(logger) << "Search completed: " << search_string; | 1259 | LOG_DEBUG(logger) << "Search completed: " << search_string; |
72 | 1255 | 1260 | ||
73 | 1256 | search_bar_->SetSearchFinished(); | 1261 | search_bar_->SetSearchFinished(); |
80 | 1257 | search_in_progress_ = false; | 1262 | |
81 | 1258 | 1263 | if (activate_on_finish_) | |
82 | 1259 | activate_timeout_.reset(); | 1264 | { |
83 | 1260 | if (activate_on_finish_ && !err) | 1265 | activate_on_finish_ = false; |
84 | 1261 | OnEntryActivated(); | 1266 | activate_delay_.reset(); |
85 | 1262 | activate_on_finish_= false; | 1267 | |
86 | 1268 | if (!err) | ||
87 | 1269 | active_scope_view_->ActivateFirst(); | ||
88 | 1270 | } | ||
89 | 1263 | } | 1271 | } |
90 | 1264 | } | 1272 | } |
91 | 1265 | 1273 | ||
92 | @@ -1407,20 +1415,12 @@ | |||
93 | 1407 | } | 1415 | } |
94 | 1408 | void DashView::OnEntryActivated() | 1416 | void DashView::OnEntryActivated() |
95 | 1409 | { | 1417 | { |
107 | 1410 | if (active_scope_view_.IsValid() && !search_in_progress_) | 1418 | if (active_scope_view_.IsValid()) |
108 | 1411 | { | 1419 | { |
109 | 1412 | active_scope_view_->ActivateFirst(); | 1420 | if (!activate_delay_ && !search_bar_->in_live_search()) |
99 | 1413 | } | ||
100 | 1414 | // delay the activation until we get the SearchFinished signal | ||
101 | 1415 | activate_on_finish_ = search_in_progress_; | ||
102 | 1416 | |||
103 | 1417 | if (activate_on_finish_) | ||
104 | 1418 | { | ||
105 | 1419 | activate_timeout_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] { | ||
106 | 1420 | activate_on_finish_ = false; | ||
110 | 1421 | active_scope_view_->ActivateFirst(); | 1421 | active_scope_view_->ActivateFirst(); |
113 | 1422 | return FALSE; | 1422 | else |
114 | 1423 | })); | 1423 | activate_on_finish_ = true; |
115 | 1424 | } | 1424 | } |
116 | 1425 | } | 1425 | } |
117 | 1426 | 1426 | ||
118 | 1427 | 1427 | ||
119 | === modified file 'dash/DashView.h' | |||
120 | --- dash/DashView.h 2015-02-03 09:46:48 +0000 | |||
121 | +++ dash/DashView.h 2015-04-24 13:00:45 +0000 | |||
122 | @@ -170,10 +170,8 @@ | |||
123 | 170 | 170 | ||
124 | 171 | LocalResult last_activated_result_; | 171 | LocalResult last_activated_result_; |
125 | 172 | guint64 last_activated_timestamp_; | 172 | guint64 last_activated_timestamp_; |
126 | 173 | bool search_in_progress_; | ||
127 | 174 | bool activate_on_finish_; | 173 | bool activate_on_finish_; |
130 | 175 | glib::Source::UniquePtr activate_timeout_; | 174 | glib::Source::UniquePtr activate_delay_; |
129 | 176 | |||
131 | 177 | bool visible_; | 175 | bool visible_; |
132 | 178 | 176 | ||
133 | 179 | nux::ObjectPtr<nux::IOpenGLBaseTexture> dash_view_copy_; | 177 | nux::ObjectPtr<nux::IOpenGLBaseTexture> dash_view_copy_; |
134 | 180 | 178 | ||
135 | === modified file 'dash/ResultView.cpp' | |||
136 | --- dash/ResultView.cpp 2014-03-20 05:13:04 +0000 | |||
137 | +++ dash/ResultView.cpp 2015-04-24 13:00:45 +0000 | |||
138 | @@ -23,6 +23,7 @@ | |||
139 | 23 | 23 | ||
140 | 24 | #include "ResultView.h" | 24 | #include "ResultView.h" |
141 | 25 | 25 | ||
142 | 26 | #include <boost/algorithm/string.hpp> | ||
143 | 26 | #include <Nux/Layout.h> | 27 | #include <Nux/Layout.h> |
144 | 27 | 28 | ||
145 | 28 | #include "unity-shared/IntrospectableWrappers.h" | 29 | #include "unity-shared/IntrospectableWrappers.h" |
146 | @@ -49,6 +50,7 @@ | |||
147 | 49 | , scale(DEFAULT_SCALE) | 50 | , scale(DEFAULT_SCALE) |
148 | 50 | , renderer_(NULL) | 51 | , renderer_(NULL) |
149 | 51 | , cached_result_(nullptr, nullptr, nullptr) | 52 | , cached_result_(nullptr, nullptr, nullptr) |
150 | 53 | , default_click_activation_(ActivateType::PREVIEW) | ||
151 | 52 | { | 54 | { |
152 | 53 | expanded.changed.connect([this](bool value) | 55 | expanded.changed.connect([this](bool value) |
153 | 54 | { | 56 | { |
154 | @@ -61,6 +63,21 @@ | |||
155 | 61 | NeedRedraw(); | 63 | NeedRedraw(); |
156 | 62 | }); | 64 | }); |
157 | 63 | 65 | ||
158 | 66 | default_click_activation.SetGetterFunction([this] { | ||
159 | 67 | if (Settings::Instance().double_click_activate()) | ||
160 | 68 | return default_click_activation_; | ||
161 | 69 | return ActivateType::DIRECT; | ||
162 | 70 | }); | ||
163 | 71 | |||
164 | 72 | default_click_activation.SetSetterFunction([this] (ActivateType at) { | ||
165 | 73 | if (default_click_activation_ != at) | ||
166 | 74 | { | ||
167 | 75 | default_click_activation_ = at; | ||
168 | 76 | return true; | ||
169 | 77 | } | ||
170 | 78 | return false; | ||
171 | 79 | }); | ||
172 | 80 | |||
173 | 64 | Settings::Instance().font_scaling.changed.connect(sigc::mem_fun(this, &ResultView::UpdateFontScale)); | 81 | Settings::Instance().font_scaling.changed.connect(sigc::mem_fun(this, &ResultView::UpdateFontScale)); |
174 | 65 | enable_texture_render.changed.connect(sigc::mem_fun(this, &ResultView::OnEnableRenderToTexture)); | 82 | enable_texture_render.changed.connect(sigc::mem_fun(this, &ResultView::OnEnableRenderToTexture)); |
175 | 66 | scale.changed.connect(sigc::mem_fun(this, &ResultView::UpdateScale)); | 83 | scale.changed.connect(sigc::mem_fun(this, &ResultView::UpdateScale)); |
176 | @@ -208,6 +225,14 @@ | |||
177 | 208 | return LocalResult(*GetIteratorAtRow(index)); | 225 | return LocalResult(*GetIteratorAtRow(index)); |
178 | 209 | } | 226 | } |
179 | 210 | 227 | ||
180 | 228 | ResultView::ActivateType ResultView::GetLocalResultActivateType(LocalResult const& result) const | ||
181 | 229 | { | ||
182 | 230 | if (boost::starts_with(result.uri, "x-unity-no-preview")) | ||
183 | 231 | return ActivateType::DIRECT; | ||
184 | 232 | |||
185 | 233 | return ActivateType::PREVIEW; | ||
186 | 234 | } | ||
187 | 235 | |||
188 | 211 | void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) | 236 | void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
189 | 212 | {} | 237 | {} |
190 | 213 | 238 | ||
191 | 214 | 239 | ||
192 | === modified file 'dash/ResultView.h' | |||
193 | --- dash/ResultView.h 2014-03-20 05:13:04 +0000 | |||
194 | +++ dash/ResultView.h 2015-04-24 13:00:45 +0000 | |||
195 | @@ -58,12 +58,11 @@ | |||
196 | 58 | class ResultView : public nux::View, public debug::Introspectable | 58 | class ResultView : public nux::View, public debug::Introspectable |
197 | 59 | { | 59 | { |
198 | 60 | public: | 60 | public: |
200 | 61 | typedef enum ActivateType_ | 61 | enum class ActivateType |
201 | 62 | { | 62 | { |
202 | 63 | DIRECT, | 63 | DIRECT, |
203 | 64 | PREVIEW_LEFT_BUTTON, | ||
204 | 65 | PREVIEW | 64 | PREVIEW |
206 | 66 | } ActivateType; | 65 | }; |
207 | 67 | 66 | ||
208 | 68 | NUX_DECLARE_OBJECT_TYPE(ResultView, nux::View); | 67 | NUX_DECLARE_OBJECT_TYPE(ResultView, nux::View); |
209 | 69 | 68 | ||
210 | @@ -73,8 +72,9 @@ | |||
211 | 73 | void SetModelRenderer(ResultRenderer* renderer); | 72 | void SetModelRenderer(ResultRenderer* renderer); |
212 | 74 | void SetResultsModel(Results::Ptr const& results); | 73 | void SetResultsModel(Results::Ptr const& results); |
213 | 75 | 74 | ||
215 | 76 | unsigned int GetIndexForLocalResult(LocalResult const& local_result); | 75 | unsigned int GetIndexForLocalResult(LocalResult const&); |
216 | 77 | LocalResult GetLocalResultForIndex(unsigned int); | 76 | LocalResult GetLocalResultForIndex(unsigned int); |
217 | 77 | ActivateType GetLocalResultActivateType(LocalResult const&) const; | ||
218 | 78 | 78 | ||
219 | 79 | nux::Property<bool> expanded; | 79 | nux::Property<bool> expanded; |
220 | 80 | nux::Property<int> results_per_row; | 80 | nux::Property<int> results_per_row; |
221 | @@ -82,6 +82,7 @@ | |||
222 | 82 | nux::Property<float> desaturation_progress; | 82 | nux::Property<float> desaturation_progress; |
223 | 83 | nux::Property<bool> enable_texture_render; | 83 | nux::Property<bool> enable_texture_render; |
224 | 84 | nux::Property<double> scale; | 84 | nux::Property<double> scale; |
225 | 85 | nux::RWProperty<ActivateType> default_click_activation; | ||
226 | 85 | 86 | ||
227 | 86 | sigc::signal<void, LocalResult const&, ActivateType, GVariant*> ResultActivated; | 87 | sigc::signal<void, LocalResult const&, ActivateType, GVariant*> ResultActivated; |
228 | 87 | 88 | ||
229 | @@ -130,6 +131,7 @@ | |||
230 | 130 | void UpdateFontScale(double scale); | 131 | void UpdateFontScale(double scale); |
231 | 131 | 132 | ||
232 | 132 | Result cached_result_; | 133 | Result cached_result_; |
233 | 134 | ActivateType default_click_activation_; | ||
234 | 133 | connection::Manager result_connections_; | 135 | connection::Manager result_connections_; |
235 | 134 | }; | 136 | }; |
236 | 135 | 137 | ||
237 | 136 | 138 | ||
238 | === modified file 'dash/ResultViewGrid.cpp' | |||
239 | --- dash/ResultViewGrid.cpp 2014-03-20 04:05:39 +0000 | |||
240 | +++ dash/ResultViewGrid.cpp 2015-04-24 13:00:45 +0000 | |||
241 | @@ -24,8 +24,6 @@ | |||
242 | 24 | #include <NuxCore/Logger.h> | 24 | #include <NuxCore/Logger.h> |
243 | 25 | #include <Nux/VLayout.h> | 25 | #include <Nux/VLayout.h> |
244 | 26 | #include <NuxGraphics/GdkGraphics.h> | 26 | #include <NuxGraphics/GdkGraphics.h> |
245 | 27 | #include <gtk/gtk.h> | ||
246 | 28 | #include <gdk/gdk.h> | ||
247 | 29 | #include <unity-protocol.h> | 27 | #include <unity-protocol.h> |
248 | 30 | 28 | ||
249 | 31 | #include "unity-shared/IntrospectableWrappers.h" | 29 | #include "unity-shared/IntrospectableWrappers.h" |
250 | @@ -34,7 +32,6 @@ | |||
251 | 34 | #include "unity-shared/UBusMessages.h" | 32 | #include "unity-shared/UBusMessages.h" |
252 | 35 | #include "unity-shared/GraphicsUtils.h" | 33 | #include "unity-shared/GraphicsUtils.h" |
253 | 36 | #include "unity-shared/RawPixel.h" | 34 | #include "unity-shared/RawPixel.h" |
254 | 37 | #include "unity-shared/UnitySettings.h" | ||
255 | 38 | #include "unity-shared/WindowManager.h" | 35 | #include "unity-shared/WindowManager.h" |
256 | 39 | #include "ResultViewGrid.h" | 36 | #include "ResultViewGrid.h" |
257 | 40 | #include "math.h" | 37 | #include "math.h" |
258 | @@ -94,8 +91,7 @@ | |||
259 | 94 | scale.changed.connect(sigc::mem_fun(this, &ResultViewGrid::UpdateScale)); | 91 | scale.changed.connect(sigc::mem_fun(this, &ResultViewGrid::UpdateScale)); |
260 | 95 | 92 | ||
261 | 96 | key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange)); | 93 | key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange)); |
264 | 97 | key_nav_focus_activate.connect([this] (nux::Area *area) | 94 | key_nav_focus_activate.connect([this] (nux::Area *area) { |
263 | 98 | { | ||
265 | 99 | Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT); | 95 | Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT); |
266 | 100 | }); | 96 | }); |
267 | 101 | key_down.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyDown)); | 97 | key_down.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyDown)); |
268 | @@ -210,6 +206,12 @@ | |||
269 | 210 | row_y += row_index * row_height; | 206 | row_y += row_index * row_height; |
270 | 211 | } | 207 | } |
271 | 212 | 208 | ||
272 | 209 | if (type == ActivateType::PREVIEW) | ||
273 | 210 | { | ||
274 | 211 | if (GetLocalResultActivateType(local_result) != type) | ||
275 | 212 | type = ActivateType::DIRECT; | ||
276 | 213 | } | ||
277 | 214 | |||
278 | 213 | active_index_ = index; | 215 | active_index_ = index; |
279 | 214 | guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp; | 216 | guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp; |
280 | 215 | glib::Variant data(g_variant_new("(tiiiiii)", timestamp, column_x, row_y, column_width, row_height, left_results, right_results)); | 217 | glib::Variant data(g_variant_new("(tiiiiii)", timestamp, column_x, row_y, column_width, row_height, left_results, right_results)); |
281 | @@ -796,6 +798,7 @@ | |||
282 | 796 | unsigned num_results = GetNumResults(); | 798 | unsigned num_results = GetNumResults(); |
283 | 797 | unsigned index = GetIndexAtPosition(x, y); | 799 | unsigned index = GetIndexAtPosition(x, y); |
284 | 798 | mouse_over_index_ = index; | 800 | mouse_over_index_ = index; |
285 | 801 | |||
286 | 799 | if (index < num_results) | 802 | if (index < num_results) |
287 | 800 | { | 803 | { |
288 | 801 | // we got a click on a button so activate it | 804 | // we got a click on a button so activate it |
289 | @@ -805,32 +808,32 @@ | |||
290 | 805 | focused_result_ = result; | 808 | focused_result_ = result; |
291 | 806 | activated_result_ = result; | 809 | activated_result_ = result; |
292 | 807 | 810 | ||
293 | 808 | |||
294 | 809 | if (nux::GetEventButton(button_flags) == nux::NUX_MOUSE_BUTTON1) | 811 | if (nux::GetEventButton(button_flags) == nux::NUX_MOUSE_BUTTON1) |
295 | 810 | { | 812 | { |
297 | 811 | if (unity::Settings::Instance().double_click_activate) | 813 | if (default_click_activation() == ActivateType::PREVIEW && |
298 | 814 | GetLocalResultActivateType(activated_result_) == ActivateType::PREVIEW) | ||
299 | 812 | { | 815 | { |
300 | 813 | // delay activate for single left click. (for double click check) | 816 | // delay activate for single left click. (for double click check) |
303 | 814 | activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index]() { | 817 | activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index] { |
304 | 815 | Activate(activated_result_, index, ResultView::ActivateType::PREVIEW_LEFT_BUTTON); | 818 | Activate(activated_result_, index, ActivateType::PREVIEW); |
305 | 816 | return false; | 819 | return false; |
306 | 817 | })); | 820 | })); |
307 | 818 | } | 821 | } |
308 | 819 | else | 822 | else |
309 | 820 | { | 823 | { |
311 | 821 | Activate(activated_result_, index, ResultView::ActivateType::DIRECT); | 824 | Activate(activated_result_, index, ActivateType::DIRECT); |
312 | 822 | } | 825 | } |
313 | 823 | } | 826 | } |
314 | 824 | else | 827 | else |
315 | 825 | { | 828 | { |
317 | 826 | Activate(activated_result_, index, ResultView::ActivateType::PREVIEW); | 829 | Activate(activated_result_, index, ActivateType::PREVIEW); |
318 | 827 | } | 830 | } |
319 | 828 | } | 831 | } |
320 | 829 | } | 832 | } |
321 | 830 | 833 | ||
322 | 831 | void ResultViewGrid::MouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags) | 834 | void ResultViewGrid::MouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags) |
323 | 832 | { | 835 | { |
325 | 833 | if (unity::Settings::Instance().double_click_activate == false) | 836 | if (default_click_activation() == ActivateType::DIRECT) |
326 | 834 | return; | 837 | return; |
327 | 835 | 838 | ||
328 | 836 | unsigned num_results = GetNumResults(); | 839 | unsigned num_results = GetNumResults(); |
329 | @@ -845,7 +848,7 @@ | |||
330 | 845 | focused_result_ = result; | 848 | focused_result_ = result; |
331 | 846 | 849 | ||
332 | 847 | activated_result_ = result; | 850 | activated_result_ = result; |
334 | 848 | Activate(activated_result_, index, ResultView::ActivateType::DIRECT); | 851 | Activate(activated_result_, index, ActivateType::DIRECT); |
335 | 849 | } | 852 | } |
336 | 850 | } | 853 | } |
337 | 851 | 854 | ||
338 | 852 | 855 | ||
339 | === modified file 'dash/ScopeView.cpp' | |||
340 | --- dash/ScopeView.cpp 2014-07-11 22:26:26 +0000 | |||
341 | +++ dash/ScopeView.cpp 2015-04-24 13:00:45 +0000 | |||
342 | @@ -481,47 +481,40 @@ | |||
343 | 481 | /* Reset result count */ | 481 | /* Reset result count */ |
344 | 482 | counts_[group] = 0; | 482 | counts_[group] = 0; |
345 | 483 | 483 | ||
347 | 484 | ResultView* results_view = nullptr; | 484 | auto* results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); |
348 | 485 | |||
349 | 485 | if (category.GetContentType() == "social" && category.renderer_name == "default") | 486 | if (category.GetContentType() == "social" && category.renderer_name == "default") |
350 | 486 | { | 487 | { |
351 | 487 | results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); | ||
352 | 488 | results_view->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION)); | 488 | results_view->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION)); |
355 | 489 | static_cast<ResultViewGrid*> (results_view)->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale()); | 489 | results_view->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale()); |
356 | 490 | static_cast<ResultViewGrid*> (results_view)->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale()); | 490 | results_view->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale()); |
357 | 491 | } | 491 | } |
358 | 492 | else | 492 | else |
359 | 493 | { | 493 | { |
360 | 494 | results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); | ||
361 | 495 | results_view->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION)); | 494 | results_view->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION)); |
362 | 496 | } | 495 | } |
363 | 497 | 496 | ||
364 | 498 | if (scope_) | 497 | if (scope_) |
365 | 499 | { | 498 | { |
369 | 500 | const std::string category_id = category.id(); | 499 | results_view->unique_id = name + scope_->name(); |
367 | 501 | std::string unique_id = category.name() + scope_->name(); | ||
368 | 502 | results_view->unique_id = unique_id; | ||
370 | 503 | results_view->expanded = false; | 500 | results_view->expanded = false; |
371 | 504 | 501 | ||
385 | 505 | results_view->ResultActivated.connect([this, unique_id, category_id] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data) | 502 | if (scope_->id() == "applications.scope" || |
386 | 506 | { | 503 | (scope_->id() == "home.scope" && category.id() == "applications.scope")) |
387 | 507 | if (g_str_has_prefix(local_result.uri.c_str(), "x-unity-no-preview")) | 504 | { |
388 | 508 | type = ResultView::ActivateType::DIRECT; | 505 | results_view->default_click_activation = ResultView::ActivateType::DIRECT; |
389 | 509 | 506 | } | |
390 | 510 | // Applications scope results should be activated on left-click (instead of preview). Note that app scope can still | 507 | |
391 | 511 | // respond with preview for activation request (the case for uninstalled apps). | 508 | results_view->ResultActivated.connect([this, results_view] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data) |
392 | 512 | bool is_app_scope_result = (scope_->id() == "applications.scope" || (scope_->id() == "home.scope" && category_id == "applications.scope")); | 509 | { |
393 | 513 | 510 | result_activated.emit(type, local_result, data, results_view->unique_id()); | |
394 | 514 | if (is_app_scope_result && type == ResultView::ActivateType::PREVIEW_LEFT_BUTTON) | 511 | |
382 | 515 | type = ResultView::ActivateType::DIRECT; | ||
383 | 516 | |||
384 | 517 | result_activated.emit(type, local_result, data, unique_id); | ||
395 | 518 | switch (type) | 512 | switch (type) |
396 | 519 | { | 513 | { |
397 | 520 | case ResultView::ActivateType::DIRECT: | 514 | case ResultView::ActivateType::DIRECT: |
398 | 521 | { | 515 | { |
399 | 522 | scope_->Activate(local_result, nullptr, cancellable_); | 516 | scope_->Activate(local_result, nullptr, cancellable_); |
400 | 523 | } break; | 517 | } break; |
401 | 524 | case ResultView::ActivateType::PREVIEW_LEFT_BUTTON: | ||
402 | 525 | case ResultView::ActivateType::PREVIEW: | 518 | case ResultView::ActivateType::PREVIEW: |
403 | 526 | { | 519 | { |
404 | 527 | scope_->Preview(local_result, nullptr, cancellable_); | 520 | scope_->Preview(local_result, nullptr, cancellable_); |
405 | 528 | 521 | ||
406 | === modified file 'hud/HudButton.cpp' | |||
407 | --- hud/HudButton.cpp 2014-07-30 00:49:35 +0000 | |||
408 | +++ hud/HudButton.cpp 2015-04-24 13:00:45 +0000 | |||
409 | @@ -20,11 +20,6 @@ | |||
410 | 20 | */ | 20 | */ |
411 | 21 | #include "config.h" | 21 | #include "config.h" |
412 | 22 | 22 | ||
413 | 23 | #include <pango/pango.h> | ||
414 | 24 | #include <pango/pangocairo.h> | ||
415 | 25 | #include <gdk/gdk.h> | ||
416 | 26 | #include <gtk/gtk.h> | ||
417 | 27 | |||
418 | 28 | #include <Nux/Nux.h> | 23 | #include <Nux/Nux.h> |
419 | 29 | #include <Nux/HLayout.h> | 24 | #include <Nux/HLayout.h> |
420 | 30 | #include <NuxGraphics/CairoGraphics.h> | 25 | #include <NuxGraphics/CairoGraphics.h> |
421 | 31 | 26 | ||
422 | === modified file 'hud/HudController.h' | |||
423 | --- hud/HudController.h 2014-07-11 01:45:49 +0000 | |||
424 | +++ hud/HudController.h 2015-04-24 13:00:45 +0000 | |||
425 | @@ -22,7 +22,6 @@ | |||
426 | 22 | #include <functional> | 22 | #include <functional> |
427 | 23 | #include <memory> | 23 | #include <memory> |
428 | 24 | 24 | ||
429 | 25 | #include <gdk/gdk.h> | ||
430 | 26 | #include <UnityCore/Hud.h> | 25 | #include <UnityCore/Hud.h> |
431 | 27 | #include <UnityCore/GLibSignal.h> | 26 | #include <UnityCore/GLibSignal.h> |
432 | 28 | 27 | ||
433 | 29 | 28 | ||
434 | === modified file 'launcher/DeviceNotificationDisplayImp.cpp' | |||
435 | --- launcher/DeviceNotificationDisplayImp.cpp 2013-10-03 23:48:48 +0000 | |||
436 | +++ launcher/DeviceNotificationDisplayImp.cpp 2015-04-24 13:00:45 +0000 | |||
437 | @@ -17,7 +17,6 @@ | |||
438 | 17 | * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> | 17 | * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> |
439 | 18 | */ | 18 | */ |
440 | 19 | 19 | ||
441 | 20 | #include <gdk/gdk.h> | ||
442 | 21 | #include "config.h" | 20 | #include "config.h" |
443 | 22 | #include <glib/gi18n-lib.h> | 21 | #include <glib/gi18n-lib.h> |
444 | 23 | #include <libnotify/notify.h> | 22 | #include <libnotify/notify.h> |
445 | 24 | 23 | ||
446 | === modified file 'unity-shared/BGHash.cpp' | |||
447 | --- unity-shared/BGHash.cpp 2014-12-11 12:54:37 +0000 | |||
448 | +++ unity-shared/BGHash.cpp 2015-04-24 13:00:45 +0000 | |||
449 | @@ -116,8 +116,11 @@ | |||
450 | 116 | .SetDuration(skip_animation ? 0 : TRANSITION_DURATION) | 116 | .SetDuration(skip_animation ? 0 : TRANSITION_DURATION) |
451 | 117 | .Start(); | 117 | .Start(); |
452 | 118 | 118 | ||
455 | 119 | // This will make sure that the animation starts even if the screen is idle. | 119 | if (nux::WindowThread* wt = nux::GetWindowThread()) |
456 | 120 | nux::GetWindowThread()->RequestRedraw(); | 120 | { |
457 | 121 | // This will make sure that the animation starts even if the screen is idle. | ||
458 | 122 | wt->RequestRedraw(); | ||
459 | 123 | } | ||
460 | 121 | } | 124 | } |
461 | 122 | 125 | ||
462 | 123 | void BGHash::OnTransitionUpdated(nux::Color const& new_color) | 126 | void BGHash::OnTransitionUpdated(nux::Color const& new_color) |
463 | 124 | 127 | ||
464 | === modified file 'unity-shared/SearchBar.cpp' | |||
465 | --- unity-shared/SearchBar.cpp 2014-09-04 22:11:33 +0000 | |||
466 | +++ unity-shared/SearchBar.cpp 2015-04-24 13:00:45 +0000 | |||
467 | @@ -141,6 +141,9 @@ | |||
468 | 141 | : View(NUX_FILE_LINE_PARAM) | 141 | : View(NUX_FILE_LINE_PARAM) |
469 | 142 | , showing_filters(false) | 142 | , showing_filters(false) |
470 | 143 | , can_refine_search(false) | 143 | , can_refine_search(false) |
471 | 144 | , im_active([this] { return pango_entry_->im_active(); }) | ||
472 | 145 | , im_preedit([this] { return pango_entry_->im_preedit(); }) | ||
473 | 146 | , in_live_search([this] { return live_search_timeout_ && live_search_timeout_->IsRunning(); }) | ||
474 | 144 | , live_search_wait(DEFAULT_LIVE_SEARCH_TIMEOUT) | 147 | , live_search_wait(DEFAULT_LIVE_SEARCH_TIMEOUT) |
475 | 145 | , scale(DEFAULT_SCALE) | 148 | , scale(DEFAULT_SCALE) |
476 | 146 | , show_filter_hint_(show_filter_hint) | 149 | , show_filter_hint_(show_filter_hint) |
477 | @@ -179,11 +182,11 @@ | |||
478 | 179 | pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown)); | 182 | pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown)); |
479 | 180 | pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus)); | 183 | pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus)); |
480 | 181 | pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) { | 184 | pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) { |
486 | 182 | if (get_im_preedit()) | 185 | if (im_preedit()) |
487 | 183 | { | 186 | { |
488 | 184 | hint_->SetVisible(false); | 187 | hint_->SetVisible(false); |
489 | 185 | hint_->QueueDraw(); | 188 | hint_->QueueDraw(); |
490 | 186 | } | 189 | } |
491 | 187 | }); | 190 | }); |
492 | 188 | 191 | ||
493 | 189 | layered_layout_ = new nux::LayeredLayout(); | 192 | layered_layout_ = new nux::LayeredLayout(); |
494 | @@ -263,10 +266,8 @@ | |||
495 | 263 | OnFontChanged(); | 266 | OnFontChanged(); |
496 | 264 | 267 | ||
497 | 265 | search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); }); | 268 | search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); }); |
499 | 266 | search_string.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_search_string)); | 269 | search_string.SetGetterFunction([this] { return pango_entry_->GetText(); }); |
500 | 267 | search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string)); | 270 | search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string)); |
501 | 268 | im_active.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_active)); | ||
502 | 269 | im_preedit.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_preedit)); | ||
503 | 270 | showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged)); | 271 | showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged)); |
504 | 271 | scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale)); | 272 | scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale)); |
505 | 272 | Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize))); | 273 | Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize))); |
506 | @@ -633,11 +634,6 @@ | |||
507 | 633 | return expander_view_; | 634 | return expander_view_; |
508 | 634 | } | 635 | } |
509 | 635 | 636 | ||
510 | 636 | std::string SearchBar::get_search_string() const | ||
511 | 637 | { | ||
512 | 638 | return pango_entry_->GetText(); | ||
513 | 639 | } | ||
514 | 640 | |||
515 | 641 | bool SearchBar::set_search_string(std::string const& string) | 637 | bool SearchBar::set_search_string(std::string const& string) |
516 | 642 | { | 638 | { |
517 | 643 | pango_entry_->SetText(string.c_str()); | 639 | pango_entry_->SetText(string.c_str()); |
518 | @@ -649,16 +645,6 @@ | |||
519 | 649 | return true; | 645 | return true; |
520 | 650 | } | 646 | } |
521 | 651 | 647 | ||
522 | 652 | bool SearchBar::get_im_active() const | ||
523 | 653 | { | ||
524 | 654 | return pango_entry_->im_active(); | ||
525 | 655 | } | ||
526 | 656 | |||
527 | 657 | bool SearchBar::get_im_preedit() const | ||
528 | 658 | { | ||
529 | 659 | return pango_entry_->im_preedit(); | ||
530 | 660 | } | ||
531 | 661 | |||
532 | 662 | // | 648 | // |
533 | 663 | // Highlight | 649 | // Highlight |
534 | 664 | // | 650 | // |
535 | 665 | 651 | ||
536 | === modified file 'unity-shared/SearchBar.h' | |||
537 | --- unity-shared/SearchBar.h 2014-08-06 19:46:43 +0000 | |||
538 | +++ unity-shared/SearchBar.h 2015-04-24 13:00:45 +0000 | |||
539 | @@ -63,6 +63,7 @@ | |||
540 | 63 | nux::Property<bool> can_refine_search; | 63 | nux::Property<bool> can_refine_search; |
541 | 64 | nux::ROProperty<bool> im_active; | 64 | nux::ROProperty<bool> im_active; |
542 | 65 | nux::ROProperty<bool> im_preedit; | 65 | nux::ROProperty<bool> im_preedit; |
543 | 66 | nux::ROProperty<bool> in_live_search; | ||
544 | 66 | nux::Property<unsigned> live_search_wait; | 67 | nux::Property<unsigned> live_search_wait; |
545 | 67 | nux::Property<double> scale; | 68 | nux::Property<double> scale; |
546 | 68 | 69 | ||
547 | @@ -88,10 +89,7 @@ | |||
548 | 88 | bool OnLiveSearchTimeout(); | 89 | bool OnLiveSearchTimeout(); |
549 | 89 | bool OnSpinnerStartCb(); | 90 | bool OnSpinnerStartCb(); |
550 | 90 | 91 | ||
551 | 91 | std::string get_search_string() const; | ||
552 | 92 | bool set_search_string(std::string const& string); | 92 | bool set_search_string(std::string const& string); |
553 | 93 | bool get_im_active() const; | ||
554 | 94 | bool get_im_preedit() const; | ||
555 | 95 | bool show_filter_hint_; | 93 | bool show_filter_hint_; |
556 | 96 | 94 | ||
557 | 97 | std::string GetName() const; | 95 | std::string GetName() const; |
FAILED: Continuous integration, rev:3960 jenkins. qa.ubuntu. com/job/ unity-ci/ 1201/ jenkins. qa.ubuntu. com/job/ unity-vivid- amd64-ci/ 89 jenkins. qa.ubuntu. com/job/ unity-vivid- armhf-ci/ 88 jenkins. qa.ubuntu. com/job/ unity-vivid- i386-ci/ 88/console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/1201/ rebuild
http://