@@ -48,6 +48,9 @@ FocusScope {
4848 property rect inputMethodRect
4949 property real rightEdgePushProgress: 0
5050 property Item availableDesktopArea
51+ property PanelState panelState
52+
53+ readonly property var temporarySelectedWorkspace: state == "spread" ? screensAndWorkspaces.activeWorkspace : null
5154
5255 // Configuration
5356 property string mode: "staged"
@@ -137,6 +140,7 @@ FocusScope {
137140 function updateFocusedAppOrientationAnimated() { /* TODO */}
138141
139142 function closeSpread() {
143+ spreadItem.highlightedIndex = -1;
140144 priv.goneToSpread = false;
141145 }
142146
@@ -243,6 +247,43 @@ FocusScope {
243247 }
244248 }
245249
250+ GlobalShortcut {
251+ id: showWorkspaceSwitcherShortcutLeft
252+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Left
253+ active: !workspaceSwitcher.active
254+ onTriggered: {
255+ root.focus = true;
256+ workspaceSwitcher.showLeft()
257+ }
258+ }
259+ GlobalShortcut {
260+ id: showWorkspaceSwitcherShortcutRight
261+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right
262+ active: !workspaceSwitcher.active
263+ onTriggered: {
264+ root.focus = true;
265+ workspaceSwitcher.showRight()
266+ }
267+ }
268+ GlobalShortcut {
269+ id: showWorkspaceSwitcherShortcutUp
270+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Up
271+ active: !workspaceSwitcher.active
272+ onTriggered: {
273+ root.focus = true;
274+ workspaceSwitcher.showUp()
275+ }
276+ }
277+ GlobalShortcut {
278+ id: showWorkspaceSwitcherShortcutDown
279+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Down
280+ active: !workspaceSwitcher.active
281+ onTriggered: {
282+ root.focus = true;
283+ workspaceSwitcher.showDown()
284+ }
285+ }
286+
246287 QtObject {
247288 id: priv
248289 objectName: "DesktopStagePrivate"
@@ -378,23 +419,23 @@ FocusScope {
378419 readonly property real windowDecorationHeight: units.gu(3)
379420 }
380421
381− Component.onCompleted: priv.updateMainAndSideStageIndexes();
422+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
382423
383424 Connections {
384− target: PanelState
425+ target: panelState
385426 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
386427 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
387428 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
388429 }
389430
390431 Binding {
391− target: PanelState
432+ target: panelState
392433 property: "decorationsVisible"
393434 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
394435 }
395436
396437 Binding {
397− target: PanelState
438+ target: panelState
398439 property: "title"
399440 value: {
400441 if (priv.focusedAppDelegate !== null) {
@@ -409,7 +450,7 @@ FocusScope {
409450 }
410451
411452 Binding {
412− target: PanelState
453+ target: panelState
413454 property: "focusedPersistentSurfaceId"
414455 value: {
415456 if (priv.focusedAppDelegate !== null) {
@@ -423,21 +464,21 @@ FocusScope {
423464 }
424465
425466 Binding {
426− target: PanelState
467+ target: panelState
427468 property: "dropShadow"
428469 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
429470 }
430471
431472 Binding {
432− target: PanelState
473+ target: panelState
433474 property: "closeButtonShown"
434475 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
435476 }
436477
437478 Component.onDestruction: {
438− PanelState.title = "";
439− PanelState.decorationsVisible = false;
440− PanelState.dropShadow = false;
479+ panelState.title = "";
480+ panelState.decorationsVisible = false;
481+ panelState.dropShadow = false;
441482 }
442483
443484 Instantiator {
@@ -483,6 +524,7 @@ FocusScope {
483524 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
484525 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
485526 PropertyChanges { target: wallpaper; visible: false }
527+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
486528 },
487529 State {
488530 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -530,11 +572,16 @@ FocusScope {
530572 Transition {
531573 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
532574 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
575+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
533576 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
577+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
534578 },
535579 Transition {
536580 to: "spread"
581+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
537582 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
583+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
584+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
538585 },
539586 Transition {
540587 from: "spread"
@@ -592,10 +639,20 @@ FocusScope {
592639 visible: false
593640 }
594641
642+ ScreensAndWorkspaces {
643+ id: screensAndWorkspaces
644+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
645+ height: Math.max(units.gu(30), parent.height * .3)
646+ background: root.background
647+ opacity: 0
648+ visible: opacity > 0
649+ onCloseSpread: priv.goneToSpread = false;
650+ }
651+
595652 Spread {
596653 id: spreadItem
597654 objectName: "spreadItem"
598− anchors.fill: appContainer
655+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
599656 leftMargin: root.availableDesktopArea.x
600657 model: root.topLevelSurfaceList
601658 spreadFlickable: floatingFlickable
@@ -610,6 +667,83 @@ FocusScope {
610667 appRepeater.itemAt(highlightedIndex).close();
611668 }
612669 }
670+
671+ FloatingFlickable {
672+ id: floatingFlickable
673+ objectName: "spreadFlickable"
674+ anchors.fill: parent
675+ enabled: false
676+ contentWidth: spreadItem.spreadTotalWidth
677+
678+ function snap(toIndex) {
679+ var delegate = appRepeater.itemAt(toIndex)
680+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
681+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
682+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
683+ snapAnimation.to = floatingFlickable.contentX - offset;
684+ snapAnimation.start();
685+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
686+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
687+ snapAnimation.to = floatingFlickable.contentX - offset;
688+ snapAnimation.start();
689+ }
690+ }
691+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
692+ }
693+
694+ MouseArea {
695+ id: hoverMouseArea
696+ objectName: "hoverMouseArea"
697+ anchors.fill: parent
698+ propagateComposedEvents: true
699+ hoverEnabled: true
700+ enabled: false
701+ visible: enabled
702+
703+ property int scrollAreaWidth: width / 3
704+ property bool progressiveScrollingEnabled: false
705+
706+ onPressed: mouse.accepted = false
707+
708+ onMouseXChanged: {
709+ mouse.accepted = false
710+
711+ if (hoverMouseArea.pressed) {
712+ return;
713+ }
714+
715+ // Find the hovered item and mark it active
716+ for (var i = appRepeater.count - 1; i >= 0; i--) {
717+ var appDelegate = appRepeater.itemAt(i);
718+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
719+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
720+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
721+ spreadItem.highlightedIndex = i;
722+ break;
723+ }
724+ }
725+
726+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
727+ var margins = floatingFlickable.width * 0.05;
728+
729+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
730+ progressiveScrollingEnabled = true
731+ }
732+
733+ // do we need to scroll?
734+ if (mouseX < scrollAreaWidth + margins) {
735+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
736+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
737+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
738+ }
739+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
740+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
741+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
742+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
743+ }
744+ }
745+ }
746+ }
613747 }
614748
615749 Connections {
@@ -704,6 +838,24 @@ FocusScope {
704838 }
705839 }
706840
841+ MirSurfaceItem {
842+ id: fakeDragItem
843+ property real previewScale: .5
844+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
845+ // w : h = iw : ih
846+ width: implicitWidth * height / implicitHeight
847+ surfaceWidth: -1
848+ surfaceHeight: -1
849+ opacity: surface != null ? 1 : 0
850+ Behavior on opacity { UbuntuNumberAnimation {} }
851+ visible: opacity > 0
852+
853+ Drag.active: surface != null
854+ Drag.keys: ["application"]
855+
856+ z: 1000
857+ }
858+
707859 Repeater {
708860 id: appRepeater
709861 model: topLevelSurfaceList
@@ -732,6 +884,9 @@ FocusScope {
732884 }
733885 z: normalZ
734886
887+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
888+ Behavior on opacity { UbuntuNumberAnimation {} }
889+
735890 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
736891 // match what the actual surface size is.
737892 // Don't write to those, they will be set by states
@@ -912,7 +1067,6 @@ FocusScope {
9121067 function claimFocus() {
9131068 if (root.state == "spread") {
9141069 spreadItem.highlightedIndex = index
915− priv.goneToSpread = false;
9161070 }
9171071 if (root.mode == "stagedWithSideStage") {
9181072 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1246,8 +1400,6 @@ FocusScope {
12461400 y: spreadMaths.targetY
12471401 z: index
12481402 height: spreadItem.spreadItemHeight
1249− requestedWidth: decoratedWindow.oldRequestedWidth
1250− requestedHeight: decoratedWindow.oldRequestedHeight
12511403 visible: spreadMaths.itemVisible
12521404 }
12531405 PropertyChanges { target: dragArea; enabled: true }
@@ -1267,8 +1419,6 @@ FocusScope {
12671419 y: stagedRightEdgeMaths.animatedY
12681420 z: stagedRightEdgeMaths.animatedZ
12691421 height: stagedRightEdgeMaths.animatedHeight
1270− requestedWidth: decoratedWindow.oldRequestedWidth
1271− requestedHeight: decoratedWindow.oldRequestedHeight
12721422 visible: appDelegate.x < root.width
12731423 }
12741424 PropertyChanges {
@@ -1298,8 +1448,6 @@ FocusScope {
12981448 y: windowedRightEdgeMaths.animatedY
12991449 z: windowedRightEdgeMaths.animatedZ
13001450 height: stagedRightEdgeMaths.animatedHeight
1301− requestedWidth: decoratedWindow.oldRequestedWidth
1302− requestedHeight: decoratedWindow.oldRequestedHeight
13031451 }
13041452 PropertyChanges {
13051453 target: decoratedWindow
@@ -1322,11 +1470,15 @@ FocusScope {
13221470 target: appDelegate
13231471 x: stageMaths.itemX
13241472 y: root.availableDesktopArea.y
1325− requestedWidth: appContainer.width
1326− requestedHeight: root.availableDesktopArea.height
13271473 visuallyMaximized: true
13281474 visible: appDelegate.x < root.width
13291475 }
1476+ PropertyChanges {
1477+ target: appDelegate
1478+ requestedWidth: appContainer.width
1479+ requestedHeight: root.availableDesktopArea.height
1480+ restoreEntryValues: false
1481+ }
13301482 PropertyChanges {
13311483 target: decoratedWindow
13321484 hasDecoration: false
@@ -1355,11 +1507,15 @@ FocusScope {
13551507 x: stageMaths.itemX
13561508 y: root.availableDesktopArea.y
13571509 z: stageMaths.itemZ
1358− requestedWidth: stageMaths.itemWidth
1359− requestedHeight: root.availableDesktopArea.height
13601510 visuallyMaximized: true
13611511 visible: appDelegate.x < root.width
13621512 }
1513+ PropertyChanges {
1514+ target: appDelegate
1515+ requestedWidth: stageMaths.itemWidth
1516+ requestedHeight: root.availableDesktopArea.height
1517+ restoreEntryValues: false
1518+ }
13631519 PropertyChanges {
13641520 target: decoratedWindow
13651521 hasDecoration: false
@@ -1381,8 +1537,12 @@ FocusScope {
13811537 requestedY: 0;
13821538 visuallyMinimized: false;
13831539 visuallyMaximized: true
1540+ }
1541+ PropertyChanges {
1542+ target: appDelegate
13841543 requestedWidth: root.availableDesktopArea.width;
13851544 requestedHeight: appContainer.height;
1545+ restoreEntryValues: false
13861546 }
13871547 PropertyChanges { target: touchControls; enabled: true }
13881548 },
@@ -1392,8 +1552,12 @@ FocusScope {
13921552 target: appDelegate;
13931553 requestedX: 0
13941554 requestedY: 0
1395− requestedWidth: appContainer.width;
1396− requestedHeight: appContainer.height;
1555+ }
1556+ PropertyChanges {
1557+ target: appDelegate
1558+ requestedWidth: appContainer.width
1559+ requestedHeight: appContainer.height
1560+ restoreEntryValues: false
13971561 }
13981562 PropertyChanges { target: decoratedWindow; hasDecoration: false }
13991563 },
@@ -1408,6 +1572,12 @@ FocusScope {
14081572 PropertyChanges { target: touchControls; enabled: true }
14091573 PropertyChanges { target: resizeArea; enabled: true }
14101574 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1575+ PropertyChanges {
1576+ target: appDelegate
1577+ requestedWidth: windowedWidth
1578+ requestedHeight: windowedHeight
1579+ restoreEntryValues: false
1580+ }
14111581 },
14121582 State {
14131583 name: "restored";
@@ -1508,6 +1678,7 @@ FocusScope {
15081678 }
15091679 }
15101680 ]
1681+
15111682 transitions: [
15121683 Transition {
15131684 from: "staged,stagedWithSideStage"
@@ -1521,6 +1692,7 @@ FocusScope {
15211692 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
15221693 },
15231694 Transition {
1695+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
15241696 to: "spread"
15251697 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
15261698 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1606,7 +1778,7 @@ FocusScope {
16061778 ]
16071779
16081780 Binding {
1609− target: PanelState
1781+ target: panelState
16101782 property: "decorationsAlwaysVisible"
16111783 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
16121784 }
@@ -1627,6 +1799,7 @@ FocusScope {
16271799 borderThickness: units.gu(2)
16281800 enabled: false
16291801 visible: enabled
1802+ readyToAssesBounds: !appDelegate._constructing
16301803
16311804 onPressed: {
16321805 appDelegate.activate();
@@ -1650,18 +1823,13 @@ FocusScope {
16501823 width: implicitWidth
16511824 height: implicitHeight
16521825 highlightSize: windowInfoItem.iconMargin / 2
1653− altDragEnabled: root.mode == "windowed"
16541826 boundsItem: root.availableDesktopArea
1827+ panelState: root.panelState
1828+ altDragEnabled: root.mode == "windowed"
16551829
16561830 requestedWidth: appDelegate.requestedWidth
16571831 requestedHeight: appDelegate.requestedHeight
16581832
1659− property int oldRequestedWidth: -1
1660− property int oldRequestedHeight: -1
1661−
1662− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1663− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1664−
16651833 onCloseClicked: { appDelegate.close(); }
16661834 onMaximizeClicked: {
16671835 if (appDelegate.canBeMaximized) {
@@ -1742,6 +1910,8 @@ FocusScope {
17421910 anchors.fill: decoratedWindow
17431911 enabled: false
17441912 closeable: !appDelegate.isDash
1913+ stage: root
1914+ dragDelegate: fakeDragItem
17451915
17461916 onClicked: {
17471917 spreadItem.highlightedIndex = index;
@@ -1784,12 +1954,15 @@ FocusScope {
17841954 objectName: "closeMouseArea"
17851955 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
17861956 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1787− visible: !appDelegate.isDash && dragArea.distance == 0
1957+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
17881958 && index == spreadItem.highlightedIndex
17891959 && mousePos.y < (decoratedWindow.height / 3)
17901960 && mousePos.y > -units.gu(4)
17911961 && mousePos.x > -units.gu(4)
17921962 && mousePos.x < (decoratedWindow.width * 2 / 3)
1963+ opacity: shown ? 1 : 0
1964+ visible: opacity > 0
1965+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
17931966 height: units.gu(6)
17941967 width: height
17951968
@@ -1860,83 +2033,20 @@ FocusScope {
18602033 leftMargin: root.availableDesktopArea.x
18612034 appContainerWidth: appContainer.width
18622035 appContainerHeight: appContainer.height
2036+ panelState: root.panelState
18632037 }
18642038
1865− MouseArea {
1866− id: hoverMouseArea
1867− objectName: "hoverMouseArea"
1868− anchors.fill: appContainer
1869− propagateComposedEvents: true
1870− hoverEnabled: true
1871− enabled: false
1872− visible: enabled
1873−
1874− property int scrollAreaWidth: width / 3
1875− property bool progressiveScrollingEnabled: false
1876−
1877− onMouseXChanged: {
1878− mouse.accepted = false
1879−
1880− if (hoverMouseArea.pressed) {
1881− return;
1882− }
1883−
1884− // Find the hovered item and mark it active
1885− for (var i = appRepeater.count - 1; i >= 0; i--) {
1886− var appDelegate = appRepeater.itemAt(i);
1887− var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1888− var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1889− if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1890− spreadItem.highlightedIndex = i;
1891− break;
1892− }
1893− }
1894−
1895− if (floatingFlickable.contentWidth > floatingFlickable.width) {
1896− var margins = floatingFlickable.width * 0.05;
1897−
1898− if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1899− progressiveScrollingEnabled = true
1900− }
1901−
1902− // do we need to scroll?
1903− if (mouseX < scrollAreaWidth + margins) {
1904− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1905− var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1906− floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1907− }
1908− if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1909− var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1910− var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1911− floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1912− }
1913− }
1914− }
1915−
1916− onPressed: mouse.accepted = false
1917− }
1918−
1919− FloatingFlickable {
1920− id: floatingFlickable
1921− objectName: "spreadFlickable"
1922− anchors.fill: appContainer
1923− enabled: false
1924− contentWidth: spreadItem.spreadTotalWidth
1925−
1926− function snap(toIndex) {
1927− var delegate = appRepeater.itemAt(toIndex)
1928− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1929− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1930− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1931− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1932− snapAnimation.start();
1933− } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1934− var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1935− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1936− snapAnimation.start();
2039+ WorkspaceSwitcher {
2040+ id: workspaceSwitcher
2041+ anchors.centerIn: parent
2042+ height: units.gu(20)
2043+ width: root.width - units.gu(8)
2044+ background: root.background
2045+ onActiveChanged: {
2046+ if (!active) {
2047+ appContainer.focus = true;
19372048 }
19382049 }
1939− UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
19402050 }
19412051
19422052 PropertyAnimation {