@@ -25,6 +25,7 @@ import GlobalShortcut 1.0
2525import GSettings 1.0
2626import "Spread"
2727import "Spread/MathUtils.js" as MathUtils
28+import WindowManager 1.0
2829
2930FocusScope {
3031 id: root
@@ -49,6 +50,8 @@ FocusScope {
4950 property real rightEdgePushProgress: 0
5051 property PanelState panelState
5152
53+ readonly property var temporarySelectedWorkspace: state == "spread" ? screensAndWorkspaces.lastClickedWorkspace : null
54+
5255 // Configuration
5356 property string mode: "staged"
5457
@@ -522,11 +525,15 @@ FocusScope {
522525 Transition {
523526 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
524527 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
528+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
529+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
525530 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
526531 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
527532 },
528533 Transition {
529534 to: "spread"
535+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
536+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
530537 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
531538 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
532539 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
@@ -545,6 +552,7 @@ FocusScope {
545552 }
546553 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
547554 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
555+ PropertyAction { target: screensAndWorkspaces; property: "lastClickedWorkspace"; value: null }
548556 }
549557 },
550558 Transition {
@@ -594,8 +602,8 @@ FocusScope {
594602 background: root.background
595603 opacity: 0
596604 visible: opacity > 0
597−
598605 onCloseSpread: priv.goneToSpread = false;
606+ onLastClickedWorkspaceChanged: activeWorkspace = lastClickedWorkspace
599607 }
600608
601609 Spread {