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
1=== modified file 'launcher/Launcher.cpp'
2--- launcher/Launcher.cpp 2012-06-15 02:03:31 +0000
3+++ launcher/Launcher.cpp 2012-06-20 19:14:18 +0000
4@@ -2139,14 +2139,14 @@
5 {
6 if (!(*it)->GetQuirk(AbstractLauncherIcon::QUIRK_VISIBLE) || !(*it)->IsVisibleOnMonitor(monitor))
7 continue;
8-
9+
10 if ((*it) == hovered_icon) {
11 if (prevIt != _model->end()) {
12 iconBeforeHover = *prevIt;
13 }
14 break;
15 }
16-
17+
18 prevIt = it;
19 }
20
21@@ -2813,6 +2813,9 @@
22 }
23 else if (_dnd_hovered_icon && _drag_action != nux::DNDACTION_NONE)
24 {
25+ if (IsOverlayOpen())
26+ ubus_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
27+
28 _dnd_hovered_icon->AcceptDrop(_dnd_data);
29 }
30
31
32=== modified file 'manual-tests/Dash.txt'
33--- manual-tests/Dash.txt 2012-04-02 14:01:37 +0000
34+++ manual-tests/Dash.txt 2012-06-20 19:14:18 +0000
35@@ -105,7 +105,7 @@
36
37 Outcome:
38 "All" should be selected by default in every filter category.
39-
40+
41 Test "All" Button 2
42 Note: Should be automated
43 -------------------
44@@ -119,7 +119,7 @@
45
46 Outcome:
47 Click on it should do nothing.
48-
49+
50
51 Test "All" Button 3
52 Note: Should be automated
53@@ -190,6 +190,20 @@
54 this saturation-process should be smooth and without flicker.
55 The tinting of the non-drag-targets should not change.
56
57+
58+Dash to Launcher document-file drag
59+-----------------------------------
60+
61+Setup:
62+#. Open the Dash (Super).
63+#. Go to the Music Lens.
64+
65+Action:
66+#. Drag any music file into the Firefox icon on the launcher.
67+
68+Outcome:
69+ The Dash should close and the music file should open up in Firefox.
70+
71 Lens Tests
72 ============
73
74@@ -217,7 +231,7 @@
75 Note: Should be automated
76 ----------------------------------------------------
77
78-Setup:
79+Setup:
80 #. Restart your computer to get a clean unity instance
81
82 Action:
83@@ -242,4 +256,4 @@
84
85 Wrong Outcome:
86 #2 and #4 both produce non-empty result which means the lenses were not
87- lazy-loaded but they were running before the first dash use.
88\ No newline at end of file
89+ lazy-loaded but they were running before the first dash use.