on xenial help sign in
don't really activate a workspace just yet when clicking on it
545b58bMichael Zanetti
qml/Shell.qml+2−1
@@ -99,8 +99,9 @@ StyledItem {
99
99
100 readonly property var topLevelSurfaceList: {
100 readonly property var topLevelSurfaceList: {
101 if (!WMScreen.currentWorkspace) return null;
101 if (!WMScreen.currentWorkspace) return null;
102− return WMScreen.currentWorkspace.windowModel
102+ return stage.temporarySelectedWorkspace ? stage.temporarySelectedWorkspace.windowModel : WMScreen.currentWorkspace.windowModel
103 }
103 }
104+ onTopLevelSurfaceListChanged: print("********************** have new TLSL", topLevelSurfaceList)
104
105
105 onMainAppChanged: {
106 onMainAppChanged: {
106 if (mainApp) {
107 if (mainApp) {
qml/Stage/Spread/ScreensAndWorkspaces.qml+10
@@ -12,6 +12,10 @@ Item {
12
12
13 property var screensProxy: Screens.createProxy();
13 property var screensProxy: Screens.createProxy();
14
14
15+ property var lastClickedWorkspace: null
16+ property var activeWorkspace: null
17+ onActiveWorkspaceChanged: print("********************* active workspace changed:", activeWorkspace)
18+
15 signal closeSpread();
19 signal closeSpread();
16
20
17 Row {
21 Row {
@@ -22,6 +26,7 @@ Item {
22// anchors.left: parent.left
26// anchors.left: parent.left
23 spacing: units.gu(1)
27 spacing: units.gu(1)
24
28
29+
25 Repeater {
30 Repeater {
26 model: screensProxy
31 model: screensProxy
27
32
@@ -149,10 +154,15 @@ Item {
149 background: root.background
154 background: root.background
150
155
151 workspaceModel: model.screen.workspaces
156 workspaceModel: model.screen.workspaces
157+ activeWorkspace: root.activeWorkspace
152 readOnly: false
158 readOnly: false
153
159
154 onCommitScreenSetup: Screens.sync(root.screensProxy)
160 onCommitScreenSetup: Screens.sync(root.screensProxy)
155 onCloseSpread: root.closeSpread();
161 onCloseSpread: root.closeSpread();
162+
163+ onClicked: {
164+ root.lastClickedWorkspace = workspace;
165+ }
156 }
166 }
157 }
167 }
158 }
168 }
qml/Stage/Spread/Workspaces.qml+7−2
@@ -17,9 +17,11 @@ Item {
17 property var background // TODO: should be stored in the workspace data
17 property var background // TODO: should be stored in the workspace data
18 property int selectedIndex: -1
18 property int selectedIndex: -1
19 property bool readOnly: true
19 property bool readOnly: true
20+ property var activeWorkspace: null
20
21
21 signal commitScreenSetup();
22 signal commitScreenSetup();
22 signal closeSpread();
23 signal closeSpread();
24+ signal clicked(var workspace);
23
25
24 DropArea {
26 DropArea {
25 anchors.fill: root
27 anchors.fill: root
@@ -87,6 +89,7 @@ Item {
87 anchors.margins: -units.gu(2)
89 anchors.margins: -units.gu(2)
88 clip: true
90 clip: true
89
91
92+
90 ListView {
93 ListView {
91 id: listView
94 id: listView
92 anchors {
95 anchors {
@@ -102,6 +105,8 @@ Item {
102 SmoothedAnimation { duration: 200 }
105 SmoothedAnimation { duration: 200 }
103 }
106 }
104
107
108+ property var clickedWorkspace: null
109+
105 orientation: ListView.Horizontal
110 orientation: ListView.Horizontal
106 spacing: units.gu(1)
111 spacing: units.gu(1)
107 leftMargin: itemWidth
112 leftMargin: itemWidth
@@ -252,14 +257,14 @@ Item {
252 screenHeight: listView.screenHeight
257 screenHeight: listView.screenHeight
253 containsDragLeft: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "left"
258 containsDragLeft: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "left"
254 containsDragRight: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "right"
259 containsDragRight: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "right"
255− isActive: model.workspace.active
260+ isActive: workspace == root.activeWorkspace
256 isSelected: index === root.selectedIndex
261 isSelected: index === root.selectedIndex
257 workspace: model.workspace
262 workspace: model.workspace
258 }
263 }
259 MouseArea {
264 MouseArea {
260 anchors.fill: parent
265 anchors.fill: parent
261 onClicked: {
266 onClicked: {
262− model.workspace.activate();
267+ root.clicked(model.workspace)
263 }
268 }
264 onDoubleClicked: {
269 onDoubleClicked: {
265 model.workspace.activate();
270 model.workspace.activate();
qml/Stage/Stage.qml+9−1
@@ -25,6 +25,7 @@ import GlobalShortcut 1.0
25import GSettings 1.0
25import GSettings 1.0
26import "Spread"
26import "Spread"
27import "Spread/MathUtils.js" as MathUtils
27import "Spread/MathUtils.js" as MathUtils
28+import WindowManager 1.0
28
29
29FocusScope {
30FocusScope {
30 id: root
31 id: root
@@ -49,6 +50,8 @@ FocusScope {
49 property real rightEdgePushProgress: 0
50 property real rightEdgePushProgress: 0
50 property PanelState panelState
51 property PanelState panelState
51
52
53+ readonly property var temporarySelectedWorkspace: state == "spread" ? screensAndWorkspaces.lastClickedWorkspace : null
54+
52 // Configuration
55 // Configuration
53 property string mode: "staged"
56 property string mode: "staged"
54
57
@@ -522,11 +525,15 @@ FocusScope {
522 Transition {
525 Transition {
523 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
526 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
524 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
527 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
528+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
529+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
525 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
530 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
526 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
531 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
527 },
532 },
528 Transition {
533 Transition {
529 to: "spread"
534 to: "spread"
535+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
536+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
530 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
537 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
531 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
538 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
532 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
539 UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
@@ -545,6 +552,7 @@ FocusScope {
545 }
552 }
546 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
553 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
547 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
554 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
555+ PropertyAction { target: screensAndWorkspaces; property: "lastClickedWorkspace"; value: null }
548 }
556 }
549 },
557 },
550 Transition {
558 Transition {
@@ -594,8 +602,8 @@ FocusScope {
594 background: root.background
602 background: root.background
595 opacity: 0
603 opacity: 0
596 visible: opacity > 0
604 visible: opacity > 0
597−
598 onCloseSpread: priv.goneToSpread = false;
605 onCloseSpread: priv.goneToSpread = false;
606+ onLastClickedWorkspaceChanged: activeWorkspace = lastClickedWorkspace
599 }
607 }
600
608
601 Spread {
609 Spread {