Merge lp:~brandontschaefer/unity/drag-icon-launcher-close-dash-fix into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Thomi Richards
Approved revision: no longer in the source branch.
Merged at revision: 2433
Proposed branch: lp:~brandontschaefer/unity/drag-icon-launcher-close-dash-fix
Merge into: lp:unity
Diff against target: 89 lines (+23/-6)
2 files modified
launcher/Launcher.cpp (+5/-2)
manual-tests/Dash.txt (+18/-4)
To merge this branch: bzr merge lp:~brandontschaefer/unity/drag-icon-launcher-close-dash-fix
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+111290@code.launchpad.net

Commit message

Documents and files now dragged from the Dash to the Launcher into an application will close the dash.

Description of the change

=== Problem ===
When dragging files from the Dash to an application in the Launcher the Dash would remain open.

=== Fix ===
If a drag drop is being processed and getting sent to a _dnd_hovered_icon and the Dash is open close the dash.

=== Test ===
Manual test added.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Approved, although we need more information about how we can test the file lens. Ideally we'd be able to make sure the file lens is showing a particular file, at which point we can write an autopilot test for this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2012-06-15 02:03:31 +0000
+++ launcher/Launcher.cpp 2012-06-20 19:14:18 +0000
@@ -2139,14 +2139,14 @@
2139 {2139 {
2140 if (!(*it)->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE) || !(*it)->IsVisibleOnMonitor(monitor))2140 if (!(*it)->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE) || !(*it)->IsVisibleOnMonitor(monitor))
2141 continue;2141 continue;
2142 2142
2143 if ((*it) == hovered_icon) {2143 if ((*it) == hovered_icon) {
2144 if (prevIt != _model->end()) {2144 if (prevIt != _model->end()) {
2145 iconBeforeHover = *prevIt;2145 iconBeforeHover = *prevIt;
2146 }2146 }
2147 break;2147 break;
2148 }2148 }
2149 2149
2150 prevIt = it;2150 prevIt = it;
2151 }2151 }
21522152
@@ -2813,6 +2813,9 @@
2813 }2813 }
2814 else if (_dnd_hovered_icon && _drag_action != nux::DNDACTION_NONE)2814 else if (_dnd_hovered_icon && _drag_action != nux::DNDACTION_NONE)
2815 {2815 {
2816 if (IsOverlayOpen())
2817 ubus_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
2818
2816 _dnd_hovered_icon->AcceptDrop(_dnd_data);2819 _dnd_hovered_icon->AcceptDrop(_dnd_data);
2817 }2820 }
28182821
28192822
=== modified file 'manual-tests/Dash.txt'
--- manual-tests/Dash.txt 2012-04-02 14:01:37 +0000
+++ manual-tests/Dash.txt 2012-06-20 19:14:18 +0000
@@ -105,7 +105,7 @@
105105
106Outcome:106Outcome:
107 "All" should be selected by default in every filter category.107 "All" should be selected by default in every filter category.
108 108
109Test "All" Button 2109Test "All" Button 2
110Note: Should be automated110Note: Should be automated
111-------------------111-------------------
@@ -119,7 +119,7 @@
119119
120Outcome:120Outcome:
121 Click on it should do nothing.121 Click on it should do nothing.
122 122
123123
124Test "All" Button 3124Test "All" Button 3
125Note: Should be automated125Note: Should be automated
@@ -190,6 +190,20 @@
190 this saturation-process should be smooth and without flicker.190 this saturation-process should be smooth and without flicker.
191 The tinting of the non-drag-targets should not change.191 The tinting of the non-drag-targets should not change.
192192
193
194Dash to Launcher document-file drag
195-----------------------------------
196
197Setup:
198#. Open the Dash (Super).
199#. Go to the Music Lens.
200
201Action:
202#. Drag any music file into the Firefox icon on the launcher.
203
204Outcome:
205 The Dash should close and the music file should open up in Firefox.
206
193Lens Tests207Lens Tests
194============208============
195209
@@ -217,7 +231,7 @@
217Note: Should be automated231Note: Should be automated
218----------------------------------------------------232----------------------------------------------------
219233
220Setup: 234Setup:
221#. Restart your computer to get a clean unity instance235#. Restart your computer to get a clean unity instance
222236
223Action:237Action:
@@ -242,4 +256,4 @@
242256
243Wrong Outcome:257Wrong Outcome:
244 #2 and #4 both produce non-empty result which means the lenses were not258 #2 and #4 both produce non-empty result which means the lenses were not
245 lazy-loaded but they were running before the first dash use.
246\ No newline at end of file259\ No newline at end of file
260 lazy-loaded but they were running before the first dash use.