Merge lp:~azzar1/unity/fix-914785 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 2324
Proposed branch: lp:~azzar1/unity/fix-914785
Merge into: lp:unity
Diff against target: 69 lines (+17/-8)
4 files modified
plugins/unityshell/src/BFBLauncherIcon.cpp (+1/-1)
plugins/unityshell/src/DashController.cpp (+1/-1)
plugins/unityshell/src/DashView.cpp (+14/-5)
plugins/unityshell/src/LauncherController.cpp (+1/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-914785
Reviewer Review Type Date Requested Status
Michal Hruby (community) lens-api-calls Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+102778@code.launchpad.net

Commit message

Don't activate "home.lens" during dash closing.

Description of the change

== Problem ==
Hiding the dash from a lens view fades out home view.

== Fix ==
Fix the behavior of DashView::OnActivateRequest.

== Test ==
A lot of dash AP tests are failing for me (on unity trunk too). If you want to make me happy, run AP tests on this branch and let me know if there are regressions.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

LGTM

review: Approve
Revision history for this message
Michal Hruby (mhr3) wrote :

Looks good on the lens side, didn't break the protocol we use. ;)

review: Approve (lens-api-calls)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/BFBLauncherIcon.cpp'
--- plugins/unityshell/src/BFBLauncherIcon.cpp 2012-03-26 10:49:24 +0000
+++ plugins/unityshell/src/BFBLauncherIcon.cpp 2012-04-19 23:40:24 +0000
@@ -91,7 +91,7 @@
9191
92void BFBLauncherIcon::ActivateLauncherIcon(ActionArg arg)92void BFBLauncherIcon::ActivateLauncherIcon(ActionArg arg)
93{93{
94 ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", 0, ""));94 ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", dash::NOT_HANDLED, ""));
9595
96 // dont chain down to avoid random dash close events96 // dont chain down to avoid random dash close events
97}97}
9898
=== modified file 'plugins/unityshell/src/DashController.cpp'
--- plugins/unityshell/src/DashController.cpp 2012-04-19 22:15:25 +0000
+++ plugins/unityshell/src/DashController.cpp 2012-04-19 23:40:24 +0000
@@ -373,7 +373,7 @@
373 std::string lens_id = view_->GetIdForShortcutActivation(std::string(key_string));373 std::string lens_id = view_->GetIdForShortcutActivation(std::string(key_string));
374 if (lens_id != "")374 if (lens_id != "")
375 {375 {
376 GVariant* args = g_variant_new("(sus)", lens_id.c_str(), 0, "");376 GVariant* args = g_variant_new("(sus)", lens_id.c_str(), dash::GOTO_DASH_URI, "");
377 OnActivateRequest(args);377 OnActivateRequest(args);
378 g_variant_unref(args);378 g_variant_unref(args);
379 return true;379 return true;
380380
=== modified file 'plugins/unityshell/src/DashView.cpp'
--- plugins/unityshell/src/DashView.cpp 2012-04-17 07:28:31 +0000
+++ plugins/unityshell/src/DashView.cpp 2012-04-19 23:40:24 +0000
@@ -338,12 +338,21 @@
338338
339 g_variant_get(args, "(sus)", &uri, &handled_type, &search_string);339 g_variant_get(args, "(sus)", &uri, &handled_type, &search_string);
340340
341 std::string id = AnalyseLensURI(uri.Str());341 std::string id(AnalyseLensURI(uri.Str()));
342342
343 lens_bar_->Activate(id);343 if (!visible_)
344344 {
345 if ((id == "home.lens" && handled_type != GOTO_DASH_URI ) || !visible_)345 lens_bar_->Activate(id);
346 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);346 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);
347 }
348 else if (/* visible_ && */ handled_type == NOT_HANDLED)
349 {
350 ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
351 }
352 else if (/* visible_ && */ handled_type == GOTO_DASH_URI)
353 {
354 lens_bar_->Activate(id);
355 }
347}356}
348357
349std::string DashView::AnalyseLensURI(std::string const& uri)358std::string DashView::AnalyseLensURI(std::string const& uri)
350359
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2012-04-11 07:02:26 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2012-04-19 23:40:24 +0000
@@ -847,7 +847,7 @@
847847
848void Controller::Impl::SendHomeActivationRequest()848void Controller::Impl::SendHomeActivationRequest()
849{849{
850 ubus.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", 0, ""));850 ubus.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", dash::NOT_HANDLED, ""));
851}851}
852852
853Controller::Controller(Display* display)853Controller::Controller(Display* display)