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
1=== modified file 'plugins/unityshell/src/BFBLauncherIcon.cpp'
2--- plugins/unityshell/src/BFBLauncherIcon.cpp 2012-03-26 10:49:24 +0000
3+++ plugins/unityshell/src/BFBLauncherIcon.cpp 2012-04-19 23:40:24 +0000
4@@ -91,7 +91,7 @@
5
6 void BFBLauncherIcon::ActivateLauncherIcon(ActionArg arg)
7 {
8- ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", 0, ""));
9+ ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", dash::NOT_HANDLED, ""));
10
11 // dont chain down to avoid random dash close events
12 }
13
14=== modified file 'plugins/unityshell/src/DashController.cpp'
15--- plugins/unityshell/src/DashController.cpp 2012-04-19 22:15:25 +0000
16+++ plugins/unityshell/src/DashController.cpp 2012-04-19 23:40:24 +0000
17@@ -373,7 +373,7 @@
18 std::string lens_id = view_->GetIdForShortcutActivation(std::string(key_string));
19 if (lens_id != "")
20 {
21- GVariant* args = g_variant_new("(sus)", lens_id.c_str(), 0, "");
22+ GVariant* args = g_variant_new("(sus)", lens_id.c_str(), dash::GOTO_DASH_URI, "");
23 OnActivateRequest(args);
24 g_variant_unref(args);
25 return true;
26
27=== modified file 'plugins/unityshell/src/DashView.cpp'
28--- plugins/unityshell/src/DashView.cpp 2012-04-17 07:28:31 +0000
29+++ plugins/unityshell/src/DashView.cpp 2012-04-19 23:40:24 +0000
30@@ -338,12 +338,21 @@
31
32 g_variant_get(args, "(sus)", &uri, &handled_type, &search_string);
33
34- std::string id = AnalyseLensURI(uri.Str());
35-
36- lens_bar_->Activate(id);
37-
38- if ((id == "home.lens" && handled_type != GOTO_DASH_URI ) || !visible_)
39+ std::string id(AnalyseLensURI(uri.Str()));
40+
41+ if (!visible_)
42+ {
43+ lens_bar_->Activate(id);
44 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);
45+ }
46+ else if (/* visible_ && */ handled_type == NOT_HANDLED)
47+ {
48+ ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
49+ }
50+ else if (/* visible_ && */ handled_type == GOTO_DASH_URI)
51+ {
52+ lens_bar_->Activate(id);
53+ }
54 }
55
56 std::string DashView::AnalyseLensURI(std::string const& uri)
57
58=== modified file 'plugins/unityshell/src/LauncherController.cpp'
59--- plugins/unityshell/src/LauncherController.cpp 2012-04-11 07:02:26 +0000
60+++ plugins/unityshell/src/LauncherController.cpp 2012-04-19 23:40:24 +0000
61@@ -847,7 +847,7 @@
62
63 void Controller::Impl::SendHomeActivationRequest()
64 {
65- ubus.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", 0, ""));
66+ ubus.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, g_variant_new("(sus)", "home.lens", dash::NOT_HANDLED, ""));
67 }
68
69 Controller::Controller(Display* display)