Merge lp:~brandontschaefer/unity/lp.1108956-fix-again into lp:unity

Proposed by Brandon Schaefer
Status: Work in progress
Proposed branch: lp:~brandontschaefer/unity/lp.1108956-fix-again
Merge into: lp:unity
Diff against target: 75 lines (+27/-5)
3 files modified
dash/DashView.cpp (+11/-4)
tests/autopilot/unity/emulators/dash.py (+6/-1)
tests/autopilot/unity/tests/test_dash.py (+10/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.1108956-fix-again
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+158450@code.launchpad.net

Commit message

If are in the Command Prompt (Alt+F2) go to the Home.Lens when pressing super or clicking the launcher icon.

Description of the change

=== Problem ===
You must be able to go from the Command Prompt (Alt+F2) to the Home Lens.

=== Fix ===
If we receive a UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, and the command lens is active. Activate that lens instead of closing the dash. As the command lens is not really a lens and should not be treated as if the dash is open. It should be treated as if it were another overlay like the Hud.

=== Test ===
AP test

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

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

Ill have to look into redoing this again.... :(

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Any new work on this? :)

Unmerged revisions

3298. By Brandon Schaefer

* If the command lens is active, and we get a super press or launcher icon click
  that is trying to open the home.lens, then switch to the home lens instead of
  closing the dash.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dash/DashView.cpp'
--- dash/DashView.cpp 2013-04-10 18:26:42 +0000
+++ dash/DashView.cpp 2013-04-11 18:16:25 +0000
@@ -1140,12 +1140,19 @@
1140 lens_bar_->Activate(id);1140 lens_bar_->Activate(id);
1141 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);1141 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);
1142 }1142 }
1143 else if (/* visible_ && */ handled_type == NOT_HANDLED)1143 else if (handled_type == NOT_HANDLED)
1144 {1144 {
1145 ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST, NULL,1145 if (lens_bar_->GetActiveLensId() == "commands.lens")
1146 glib::Source::Priority::HIGH);1146 {
1147 lens_bar_->Activate(id);
1148 }
1149 else
1150 {
1151 ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST, NULL,
1152 glib::Source::Priority::HIGH);
1153 }
1147 }1154 }
1148 else if (/* visible_ && */ handled_type == GOTO_DASH_URI)1155 else if (handled_type == GOTO_DASH_URI)
1149 {1156 {
1150 lens_bar_->Activate(id);1157 lens_bar_->Activate(id);
1151 }1158 }
11521159
=== modified file 'tests/autopilot/unity/emulators/dash.py'
--- tests/autopilot/unity/emulators/dash.py 2013-04-08 20:27:29 +0000
+++ tests/autopilot/unity/emulators/dash.py 2013-04-11 18:16:25 +0000
@@ -63,6 +63,12 @@
63 """63 """
64 Ensures the dash is hidden.64 Ensures the dash is hidden.
65 """65 """
66
67 # the command lens is special, and needs 2 super presses to exit lp.1108956
68 if self.active_lens == "commands.lens":
69 self.keybinding("dash/reveal", 0.1)
70 self.visible.wait_for(True)
71
66 if self.visible:72 if self.visible:
67 self.toggle_reveal()73 self.toggle_reveal()
68 self.visible.wait_for(False)74 self.visible.wait_for(False)
@@ -85,7 +91,6 @@
85 def preview_animation(self):91 def preview_animation(self):
86 """Returns the average progress of dash slip and animating a preview.92 """Returns the average progress of dash slip and animating a preview.
87 Between 0.0 and 1.0.93 Between 0.0 and 1.0.
88
89 """94 """
90 return self.view.preview_animation;95 return self.view.preview_animation;
9196
9297
=== modified file 'tests/autopilot/unity/tests/test_dash.py'
--- tests/autopilot/unity/tests/test_dash.py 2013-04-10 18:26:42 +0000
+++ tests/autopilot/unity/tests/test_dash.py 2013-04-11 18:16:25 +0000
@@ -76,8 +76,18 @@
76 """Switch to command lens without closing the dash."""76 """Switch to command lens without closing the dash."""
77 self.unity.dash.ensure_visible()77 self.unity.dash.ensure_visible()
78 self.unity.dash.reveal_command_lens()78 self.unity.dash.reveal_command_lens()
79 self.assertThat(self.unity.dash.visible, Eventually(Equals(True)))
79 self.assertThat(self.unity.dash.active_lens, Eventually(Equals('commands.lens')))80 self.assertThat(self.unity.dash.active_lens, Eventually(Equals('commands.lens')))
8081
82 def test_can_go_from_command_lens_to_dash(self):
83 """We must be able to go from the command lens to the dash (home lens)."""
84 self.unity.dash.reveal_command_lens()
85
86 # Since the dash is visible we can't use ensure_visible().
87 self.keybinding("dash/reveal", 0.1)
88 self.assertThat(self.unity.dash.visible, Eventually(Equals(True)))
89 self.assertThat(self.unity.dash.active_lens, Eventually(Equals('home.lens')))
90
81 def test_command_lens_can_close_itself(self):91 def test_command_lens_can_close_itself(self):
82 """We must be able to close the Command lens with Alt+F2"""92 """We must be able to close the Command lens with Alt+F2"""
83 self.unity.dash.reveal_command_lens()93 self.unity.dash.reveal_command_lens()