@@ -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: "buttonsVisible"
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,21 +377,21 @@ FocusScope {
376377 }
377378
378379 Binding {
379− target: PanelState
380+ target: panelState
380381 property: "dropShadow"
381382 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
382383 }
383384
384385 Binding {
385− target: PanelState
386+ target: panelState
386387 property: "closeButtonShown"
387388 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
388389 }
389390
390391 Component.onDestruction: {
391− PanelState.title = "";
392− PanelState.buttonsVisible = false;
393− PanelState.dropShadow = false;
392+ panelState.title = "";
393+ panelState.buttonsVisible = false;
394+ panelState.dropShadow = false;
394395 }
395396
396397 Instantiator {
@@ -468,7 +469,7 @@ FocusScope {
468469 },
469470 State {
470471 name: "staged"; when: root.mode === "staged"
471− PropertyChanges { target: wallpaper; visible: false }
472+ PropertyChanges { target: wallpaper; visible: priv.focusedAppDelegate && priv.focusedAppDelegate.x === 0 }
472473 },
473474 State {
474475 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
@@ -545,10 +546,16 @@ FocusScope {
545546 visible: false
546547 }
547548
549+ ScreensAndWorkspaces {
550+ id: screensAndWorkspaces
551+ anchors { left: parent.left; top: parent.top; right: parent.right }
552+ height: parent.height / 3
553+ }
554+
548555 Spread {
549556 id: spreadItem
550557 objectName: "spreadItem"
551− anchors.fill: appContainer
558+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
552559 leftMargin: root.leftMargin
553560 model: root.topLevelSurfaceList
554561 spreadFlickable: floatingFlickable
@@ -739,7 +746,7 @@ FocusScope {
739746 target: appDelegate
740747 property: "y"
741748 value: appDelegate.requestedY -
742− Math.min(appDelegate.requestedY - PanelState.panelHeight,
749+ Math.min(appDelegate.requestedY - panelState.panelHeight,
743750 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
744751 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
745752 && root.inputMethodRect.height > 0
@@ -876,7 +883,7 @@ FocusScope {
876883 screenWidth: appContainer.width
877884 screenHeight: appContainer.height
878885 leftMargin: root.leftMargin
879− minimumY: PanelState.panelHeight
886+ minimumY: panelState.panelHeight
880887 }
881888
882889 Connections {
@@ -1116,7 +1123,7 @@ FocusScope {
11161123 progress: 0
11171124 targetHeight: spreadItem.stackHeight
11181125 targetX: spreadMaths.targetX
1119− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1126+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
11201127 targetY: spreadMaths.targetY
11211128 targetAngle: spreadMaths.targetAngle
11221129 targetScale: spreadMaths.targetScale
@@ -1235,9 +1242,9 @@ FocusScope {
12351242 PropertyChanges {
12361243 target: appDelegate
12371244 x: stageMaths.itemX
1238− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1245+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12391246 requestedWidth: appContainer.width
1240− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1247+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12411248 visuallyMaximized: true
12421249 visible: appDelegate.x < root.width
12431250 }
@@ -1263,10 +1270,10 @@ FocusScope {
12631270 PropertyChanges {
12641271 target: appDelegate
12651272 x: stageMaths.itemX
1266− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1273+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12671274 z: stageMaths.itemZ
12681275 requestedWidth: stageMaths.itemWidth
1269− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1276+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12701277 visuallyMaximized: true
12711278 visible: appDelegate.x < root.width
12721279 }
@@ -1331,9 +1338,9 @@ FocusScope {
13311338 PropertyChanges {
13321339 target: appDelegate
13331340 windowedX: root.leftMargin
1334− windowedY: PanelState.panelHeight
1341+ windowedY: panelState.panelHeight
13351342 windowedWidth: (appContainer.width - root.leftMargin)/2
1336− windowedHeight: appContainer.height - PanelState.panelHeight
1343+ windowedHeight: appContainer.height - panelState.panelHeight
13371344 }
13381345 },
13391346 State {
@@ -1350,9 +1357,9 @@ FocusScope {
13501357 PropertyChanges {
13511358 target: appDelegate
13521359 windowedX: root.leftMargin
1353− windowedY: PanelState.panelHeight
1360+ windowedY: panelState.panelHeight
13541361 windowedWidth: (appContainer.width - root.leftMargin)/2
1355− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1362+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
13561363 }
13571364 },
13581365 State {
@@ -1369,7 +1376,7 @@ FocusScope {
13691376 PropertyChanges {
13701377 target: appDelegate
13711378 windowedX: root.leftMargin
1372− windowedY: (appContainer.height + PanelState.panelHeight)/2
1379+ windowedY: (appContainer.height + panelState.panelHeight)/2
13731380 windowedWidth: (appContainer.width - root.leftMargin)/2
13741381 windowedHeight: appContainer.height/2
13751382 }
@@ -1391,8 +1398,8 @@ FocusScope {
13911398 State {
13921399 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
13931400 extend: "normal"
1394− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1395− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1401+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1402+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
13961403 },
13971404 State {
13981405 name: "minimized"; when: appDelegate.minimized
@@ -1491,7 +1498,7 @@ FocusScope {
14911498 ]
14921499
14931500 Binding {
1494− target: PanelState
1501+ target: panelState
14951502 property: "buttonsAlwaysVisible"
14961503 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
14971504 }
@@ -1506,7 +1513,7 @@ FocusScope {
15061513 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
15071514
15081515 target: appDelegate
1509− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1516+ minimumY: panelState.panelHeight // disallow resizing up past Panel
15101517 minWidth: units.gu(10)
15111518 minHeight: units.gu(10)
15121519 borderThickness: units.gu(2)
@@ -1536,6 +1543,7 @@ FocusScope {
15361543 highlightSize: windowInfoItem.iconMargin / 2
15371544 stageWidth: appContainer.width
15381545 stageHeight: appContainer.height
1546+ panelState: root.panelState
15391547
15401548 requestedWidth: appDelegate.requestedWidth
15411549 requestedHeight: appDelegate.requestedHeight
@@ -1595,6 +1603,7 @@ FocusScope {
15951603 visible: enabled
15961604 stageWidth: appContainer.width
15971605 stageHeight: appContainer.height
1606+ panelState: root.panelState
15981607
15991608 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
16001609 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1699,6 +1708,7 @@ FocusScope {
16991708 leftMargin: root.leftMargin
17001709 appContainerWidth: appContainer.width
17011710 appContainerHeight: appContainer.height
1711+ panelState: root.panelState
17021712 }
17031713
17041714 EdgeBarrier {