on xenial help sign in
properly create and destroy workspaces
44063d4Michael Zanetti
qml/Stage/Spread/Workspaces.qml+6−1
@@ -1,5 +1,6 @@
1import QtQuick 2.4
1import QtQuick 2.4
2import Ubuntu.Components 1.3
2import Ubuntu.Components 1.3
3+import WindowManager 1.0
3import "MathUtils.js" as MathUtils
4import "MathUtils.js" as MathUtils
4import "../../Components"
5import "../../Components"
5
6
@@ -38,6 +39,7 @@ Item {
38 }
39 }
39
40
40 onDropped: {
41 onDropped: {
42+ drop.accept(Qt.MoveAction);
41 listView.dropItemIndex = -1;
43 listView.dropItemIndex = -1;
42 drag.source.inDropArea = false;
44 drag.source.inDropArea = false;
43 }
45 }
@@ -219,7 +221,10 @@ Item {
219 }
221 }
220
222
221 onReleased: {
223 onReleased: {
222− fakeDragItem.Drag.drop();
224+ var result = fakeDragItem.Drag.drop();
225+ if (result == Qt.IgnoreAction) {
226+ WorkspaceManager.destroyWorkspace(fakeDragItem.workspace);
227+ }
223 drag.target = null;
228 drag.target = null;
224 }
229 }
225
230