Merge lp:~mzanetti/unity8/fix-dnd-cancelling into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1734
Merged at revision: 1740
Proposed branch: lp:~mzanetti/unity8/fix-dnd-cancelling
Merge into: lp:unity8
Diff against target: 64 lines (+37/-3)
2 files modified
qml/Launcher/LauncherPanel.qml (+5/-3)
tests/qmltests/Launcher/tst_Launcher.qml (+32/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-dnd-cancelling
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+256462@code.launchpad.net

Commit message

Make sure dnd mode is ended properly when drag gesture is cancelled

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no
 * Did you perform an exploratory manual test run of your code change and any related functionality?
yes
 * Did you make sure that your branch does not contain spurious tags?
yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
n/a

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
Albert Astals Cid (aacid) wrote :

On second drag of the same item (after it was cancelled) the item is not under my finger but seems to be displaced by the old position it was in.

review: Needs Fixing
1732. By Michael Zanetti

also reset drag.target

Revision history for this message
Albert Astals Cid (aacid) wrote :

Still needs some work, i was doing a vertical move of the dragged icon while doing the horizontal swipe in the greeter to cancel it and ended up with this

http://imgur.com/87eRnos

review: Needs Fixing
1733. By Michael Zanetti

do the full endDrag procedure in case of a cancel

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Still needs some work, i was doing a vertical move of the dragged icon while
> doing the horizontal swipe in the greeter to cancel it and ended up with this
>
> http://imgur.com/87eRnos

Should be fixed now. I can't repro it any more.

1734. By Michael Zanetti

coding style

Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
They passed locally, waiting for CI before top approving

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Launcher/LauncherPanel.qml'
--- qml/Launcher/LauncherPanel.qml 2015-02-05 14:03:32 +0000
+++ qml/Launcher/LauncherPanel.qml 2015-04-17 13:31:44 +0000
@@ -338,12 +338,14 @@
338 }338 }
339339
340 onCanceled: {340 onCanceled: {
341 selectedItem = undefined;341 endDrag();
342 preDragging = false;
343 postDragging = false;
344 }342 }
345343
346 onReleased: {344 onReleased: {
345 endDrag();
346 }
347
348 function endDrag() {
347 var droppedIndex = draggedIndex;349 var droppedIndex = draggedIndex;
348 if (dragging) {350 if (dragging) {
349 postDragging = true;351 postDragging = true;
350352
=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
--- tests/qmltests/Launcher/tst_Launcher.qml 2015-03-13 14:32:45 +0000
+++ tests/qmltests/Launcher/tst_Launcher.qml 2015-04-17 13:31:44 +0000
@@ -459,6 +459,38 @@
459 waitUntilLauncherDisappears();459 waitUntilLauncherDisappears();
460 }460 }
461461
462 function test_dragndrop_cancel() {
463 dragLauncherIntoView();
464 var draggedItem = findChild(launcher, "launcherDelegate4")
465 var item0 = findChild(launcher, "launcherDelegate0")
466 var fakeDragItem = findChild(launcher, "fakeDragItem")
467
468 // Doing longpress
469 var currentMouseX = draggedItem.width / 2
470 var currentMouseY = draggedItem.height / 2
471 mousePress(draggedItem, currentMouseX, currentMouseY)
472 // DraggedItem needs to hide and fakeDragItem become visible
473 tryCompare(draggedItem, "itemOpacity", 0)
474 tryCompare(fakeDragItem, "visible", true)
475
476 // Dragging
477 currentMouseX -= units.gu(20)
478 mouseMove(draggedItem, currentMouseX, currentMouseY)
479
480 // Make sure we're in the dragging state
481 var dndArea = findChild(launcher, "dndArea");
482 tryCompare(draggedItem, "dragging", true)
483 tryCompare(dndArea, "draggedIndex", 4)
484
485 // Tap somewhere in the middle of the screen to close/hide the launcher
486 tap(root)
487
488 // Make sure the dnd operation has been stopped
489 tryCompare(draggedItem, "dragging", false)
490 tryCompare(dndArea, "draggedIndex", -1)
491 tryCompare(dndArea, "drag.target", undefined)
492 }
493
462 function test_quicklist_dismiss() {494 function test_quicklist_dismiss() {
463 dragLauncherIntoView();495 dragLauncherIntoView();
464 var draggedItem = findChild(launcher, "launcherDelegate5")496 var draggedItem = findChild(launcher, "launcherDelegate5")

Subscribers

People subscribed via source and target branches