@@ -46,6 +46,7 @@ FocusScope {
4646 property int leftMargin: 0
4747 property bool oskEnabled: false
4848 property rect inputMethodRect
49+ property PanelState panelState
4950
5051 // Configuration
5152 property string mode: "staged"
@@ -348,20 +349,20 @@ FocusScope {
348349 Component.onCompleted: priv.updateMainAndSideStageIndexes();
349350
350351 Connections {
351− target: PanelState
352+ target: panelState
352353 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353354 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354355 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
355356 }
356357
357358 Binding {
358− target: PanelState
359+ target: panelState
359360 property: "decorationsVisible"
360361 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
361362 }
362363
363364 Binding {
364− target: PanelState
365+ target: panelState
365366 property: "title"
366367 value: {
367368 if (priv.focusedAppDelegate !== null) {
@@ -376,7 +377,7 @@ FocusScope {
376377 }
377378
378379 Binding {
379− target: PanelState
380+ target: panelState
380381 property: "focusedPersistentSurfaceId"
381382 value: {
382383 if (priv.focusedAppDelegate !== null) {
@@ -390,21 +391,21 @@ FocusScope {
390391 }
391392
392393 Binding {
393− target: PanelState
394+ target: panelState
394395 property: "dropShadow"
395396 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
396397 }
397398
398399 Binding {
399− target: PanelState
400+ target: panelState
400401 property: "closeButtonShown"
401402 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
402403 }
403404
404405 Component.onDestruction: {
405− PanelState.title = "";
406− PanelState.decorationsVisible = false;
407− PanelState.dropShadow = false;
406+ panelState.title = "";
407+ panelState.decorationsVisible = false;
408+ panelState.dropShadow = false;
408409 }
409410
410411 Instantiator {
@@ -482,7 +483,7 @@ FocusScope {
482483 },
483484 State {
484485 name: "staged"; when: root.mode === "staged"
485− PropertyChanges { target: wallpaper; visible: false }
486+ PropertyChanges { target: wallpaper; visible: priv.focusedAppDelegate && priv.focusedAppDelegate.x === 0 }
486487 },
487488 State {
488489 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
@@ -559,10 +560,17 @@ FocusScope {
559560 visible: false
560561 }
561562
563+ ScreensAndWorkspaces {
564+ id: screensAndWorkspaces
565+ anchors { left: parent.left; top: parent.top; right: parent.right }
566+ height: parent.height / 3
567+ background: root.background
568+ }
569+
562570 Spread {
563571 id: spreadItem
564572 objectName: "spreadItem"
565− anchors.fill: appContainer
573+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
566574 leftMargin: root.leftMargin
567575 model: root.topLevelSurfaceList
568576 spreadFlickable: floatingFlickable
@@ -753,7 +761,7 @@ FocusScope {
753761 target: appDelegate
754762 property: "y"
755763 value: appDelegate.requestedY -
756− Math.min(appDelegate.requestedY - PanelState.panelHeight,
764+ Math.min(appDelegate.requestedY - panelState.panelHeight,
757765 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
758766 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
759767 && root.inputMethodRect.height > 0
@@ -890,7 +898,7 @@ FocusScope {
890898 screenWidth: appContainer.width
891899 screenHeight: appContainer.height
892900 leftMargin: root.leftMargin
893− minimumY: PanelState.panelHeight
901+ minimumY: panelState.panelHeight
894902 }
895903
896904 Connections {
@@ -1130,7 +1138,7 @@ FocusScope {
11301138 progress: 0
11311139 targetHeight: spreadItem.stackHeight
11321140 targetX: spreadMaths.targetX
1133− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1141+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
11341142 targetY: spreadMaths.targetY
11351143 targetAngle: spreadMaths.targetAngle
11361144 targetScale: spreadMaths.targetScale
@@ -1249,9 +1257,9 @@ FocusScope {
12491257 PropertyChanges {
12501258 target: appDelegate
12511259 x: stageMaths.itemX
1252− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1260+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12531261 requestedWidth: appContainer.width
1254− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1262+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12551263 visuallyMaximized: true
12561264 visible: appDelegate.x < root.width
12571265 }
@@ -1277,10 +1285,10 @@ FocusScope {
12771285 PropertyChanges {
12781286 target: appDelegate
12791287 x: stageMaths.itemX
1280− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1288+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12811289 z: stageMaths.itemZ
12821290 requestedWidth: stageMaths.itemWidth
1283− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1291+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12841292 visuallyMaximized: true
12851293 visible: appDelegate.x < root.width
12861294 }
@@ -1345,9 +1353,9 @@ FocusScope {
13451353 PropertyChanges {
13461354 target: appDelegate
13471355 windowedX: root.leftMargin
1348− windowedY: PanelState.panelHeight
1356+ windowedY: panelState.panelHeight
13491357 windowedWidth: (appContainer.width - root.leftMargin)/2
1350− windowedHeight: appContainer.height - PanelState.panelHeight
1358+ windowedHeight: appContainer.height - panelState.panelHeight
13511359 }
13521360 },
13531361 State {
@@ -1364,9 +1372,9 @@ FocusScope {
13641372 PropertyChanges {
13651373 target: appDelegate
13661374 windowedX: root.leftMargin
1367− windowedY: PanelState.panelHeight
1375+ windowedY: panelState.panelHeight
13681376 windowedWidth: (appContainer.width - root.leftMargin)/2
1369− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1377+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
13701378 }
13711379 },
13721380 State {
@@ -1383,7 +1391,7 @@ FocusScope {
13831391 PropertyChanges {
13841392 target: appDelegate
13851393 windowedX: root.leftMargin
1386− windowedY: (appContainer.height + PanelState.panelHeight)/2
1394+ windowedY: (appContainer.height + panelState.panelHeight)/2
13871395 windowedWidth: (appContainer.width - root.leftMargin)/2
13881396 windowedHeight: appContainer.height/2
13891397 }
@@ -1405,8 +1413,8 @@ FocusScope {
14051413 State {
14061414 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
14071415 extend: "normal"
1408− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1409− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1416+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1417+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
14101418 },
14111419 State {
14121420 name: "minimized"; when: appDelegate.minimized
@@ -1505,7 +1513,7 @@ FocusScope {
15051513 ]
15061514
15071515 Binding {
1508− target: PanelState
1516+ target: panelState
15091517 property: "decorationsAlwaysVisible"
15101518 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
15111519 }
@@ -1520,7 +1528,7 @@ FocusScope {
15201528 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
15211529
15221530 target: appDelegate
1523− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1531+ minimumY: panelState.panelHeight // disallow resizing up past Panel
15241532 minWidth: units.gu(10)
15251533 minHeight: units.gu(10)
15261534 borderThickness: units.gu(2)
@@ -1550,6 +1558,7 @@ FocusScope {
15501558 highlightSize: windowInfoItem.iconMargin / 2
15511559 stageWidth: appContainer.width
15521560 stageHeight: appContainer.height
1561+ panelState: root.panelState
15531562
15541563 requestedWidth: appDelegate.requestedWidth
15551564 requestedHeight: appDelegate.requestedHeight
@@ -1609,6 +1618,7 @@ FocusScope {
16091618 visible: enabled
16101619 stageWidth: appContainer.width
16111620 stageHeight: appContainer.height
1621+ panelState: root.panelState
16121622
16131623 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
16141624 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1713,6 +1723,7 @@ FocusScope {
17131723 leftMargin: root.leftMargin
17141724 appContainerWidth: appContainer.width
17151725 appContainerHeight: appContainer.height
1726+ panelState: root.panelState
17161727 }
17171728
17181729 EdgeBarrier {