diff options
-rw-r--r-- | imports/system/models/ApplicationManagerInterface.qml | 8 | ||||
-rw-r--r-- | sysui/LaunchController.qml | 42 |
2 files changed, 38 insertions, 12 deletions
diff --git a/imports/system/models/ApplicationManagerInterface.qml b/imports/system/models/ApplicationManagerInterface.qml index ea591b4..b8b4017 100644 --- a/imports/system/models/ApplicationManagerInterface.qml +++ b/imports/system/models/ApplicationManagerInterface.qml @@ -49,7 +49,7 @@ QtObject { property var itemsToRelease: [] signal applicationSurfaceReady(Item item, bool isMinimized) - signal releaseApplicationSurface() + signal releaseApplicationSurface(Item item) // Cluster signals signal clusterWidgetReady(string category, Item item) @@ -133,14 +133,14 @@ QtObject { function windowPropertyChanged(window, name, value) { //print(":::LaunchController::: WindowManager:windowPropertyChanged", window, name, value) if (name === "visibility" && value === false ) { - root.releaseApplicationSurface() + root.releaseApplicationSurface(window) } } function windowClosingHandler(index, item) { var type = windowTypes[item] if (type === "ivi") { // start close animation - root.releaseApplicationSurface() + root.releaseApplicationSurface(item) } } @@ -152,7 +152,7 @@ QtObject { //If the item is visible the closing application hasn't been played yet and we need to wait until it is finished if (item.visible) { itemsToRelease.push(item) - root.releaseApplicationSurface() + root.releaseApplicationSurface(item) } else { WindowManager.releaseWindow(item) } diff --git a/sysui/LaunchController.qml b/sysui/LaunchController.qml index 33f69ab..15980f5 100644 --- a/sysui/LaunchController.qml +++ b/sysui/LaunchController.qml @@ -136,7 +136,39 @@ StackView { Shortcut { context: Qt.ApplicationShortcut sequence: StandardKey.Cancel - onActivated: { root.pop(null) } + onActivated: { root.popItem(root.currentItem) } + } + + function popItem(item) { + if (root.depth <= 1) + return; + + if (root.busy) + root.completeTransition() + + if (item == root.currentItem) { + var stackItem = null; + if (root.depth > 2) + stackItem = root.get(root.depth - 2); + root.pop(stackItem) + } else { + var stack = [] + for (var i = 1; i < root.depth; ++i) { + var stackItem = root.get(i) + if (stackItem === item) { + item.parent = null; + item.visible = false; + ApplicationManagerInterface.releasingApplicationSurfaceDone(item) + } else { + print(stackItem) + stack.push({item:stackItem, immediate: true}) + } + } + root.pop(null); + for (var i = 0; i < stack.length; ++i) { + root.push(stack[i]) + } + } } Connections { @@ -153,13 +185,7 @@ StackView { } onReleaseApplicationSurface: { - if (root.depth <= 1) - return; - - if (root.busy) - root.completeTransition() - - root.pop(null) + root.popItem(item) } } } |