@@ -46,6 +46,7 @@ FocusScope {
46 property int leftMargin: 0
46 property int leftMargin: 0
47 property bool oskEnabled: false
47 property bool oskEnabled: false
48 property rect inputMethodRect
48 property rect inputMethodRect
49+ property PanelState panelState
50 // Configuration
51 // Configuration
51 property string mode: "staged"
52 property string mode: "staged"
@@ -348,20 +349,20 @@ FocusScope {
348 Component.onCompleted: priv.updateMainAndSideStageIndexes();
349 Component.onCompleted: priv.updateMainAndSideStageIndexes();
350 Connections {
351 Connections {
351− target: PanelState
352+ target: panelState
352 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
355 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
357 Binding {
358 Binding {
358− target: PanelState
359+ target: panelState
359 property: "decorationsVisible"
360 property: "decorationsVisible"
360 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
361 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
363 Binding {
364 Binding {
364− target: PanelState
365+ target: panelState
365 property: "title"
366 property: "title"
367 if (priv.focusedAppDelegate !== null) {
368 if (priv.focusedAppDelegate !== null) {
@@ -376,7 +377,7 @@ FocusScope {
378 Binding {
379 Binding {
379− target: PanelState
380+ target: panelState
380 property: "focusedPersistentSurfaceId"
381 property: "focusedPersistentSurfaceId"
382 if (priv.focusedAppDelegate !== null) {
383 if (priv.focusedAppDelegate !== null) {
@@ -390,21 +391,21 @@ FocusScope {
392 Binding {
393 Binding {
393− target: PanelState
394+ target: panelState
394 property: "dropShadow"
395 property: "dropShadow"
395 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
396 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
398 Binding {
399 Binding {
399− target: PanelState
400+ target: panelState
400 property: "closeButtonShown"
401 property: "closeButtonShown"
401 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
402 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
404 Component.onDestruction: {
405 Component.onDestruction: {
405− PanelState.title = "";
406+ panelState.title = "";
406− PanelState.decorationsVisible = false;
407+ panelState.decorationsVisible = false;
407− PanelState.dropShadow = false;
408+ panelState.dropShadow = false;
410 Instantiator {
411 Instantiator {
@@ -482,7 +483,7 @@ FocusScope {
484 name: "staged"; when: root.mode === "staged"
485 name: "staged"; when: root.mode === "staged"
485− PropertyChanges { target: wallpaper; visible: false }
486+ PropertyChanges { target: wallpaper; visible: priv.focusedAppDelegate && priv.focusedAppDelegate.x === 0 }
488 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
489 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
@@ -559,10 +560,17 @@ FocusScope {
559 visible: false
560 visible: false
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
563 id: spreadItem
571 id: spreadItem
564 objectName: "spreadItem"
572 objectName: "spreadItem"
565− anchors.fill: appContainer
573+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
566 leftMargin: root.leftMargin
574 leftMargin: root.leftMargin
567 model: root.topLevelSurfaceList
575 model: root.topLevelSurfaceList
568 spreadFlickable: floatingFlickable
576 spreadFlickable: floatingFlickable
@@ -753,7 +761,7 @@ FocusScope {
753 target: appDelegate
761 target: appDelegate
754 property: "y"
762 property: "y"
755 value: appDelegate.requestedY -
763 value: appDelegate.requestedY -
756− Math.min(appDelegate.requestedY - PanelState.panelHeight,
764+ Math.min(appDelegate.requestedY - panelState.panelHeight,
757 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
765 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
758 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
766 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
759 && root.inputMethodRect.height > 0
767 && root.inputMethodRect.height > 0
@@ -890,7 +898,7 @@ FocusScope {
890 screenWidth: appContainer.width
898 screenWidth: appContainer.width
891 screenHeight: appContainer.height
899 screenHeight: appContainer.height
892 leftMargin: root.leftMargin
900 leftMargin: root.leftMargin
893− minimumY: PanelState.panelHeight
901+ minimumY: panelState.panelHeight
896 Connections {
904 Connections {
@@ -1130,7 +1138,7 @@ FocusScope {
1130 progress: 0
1138 progress: 0
1131 targetHeight: spreadItem.stackHeight
1139 targetHeight: spreadItem.stackHeight
1132 targetX: spreadMaths.targetX
1140 targetX: spreadMaths.targetX
1133− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1141+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1134 targetY: spreadMaths.targetY
1142 targetY: spreadMaths.targetY
1135 targetAngle: spreadMaths.targetAngle
1143 targetAngle: spreadMaths.targetAngle
1136 targetScale: spreadMaths.targetScale
1144 targetScale: spreadMaths.targetScale
@@ -1249,9 +1257,9 @@ FocusScope {
1249 PropertyChanges {
1257 PropertyChanges {
1250 target: appDelegate
1258 target: appDelegate
1251 x: stageMaths.itemX
1259 x: stageMaths.itemX
1252− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1260+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1253 requestedWidth: appContainer.width
1261 requestedWidth: appContainer.width
1254− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1262+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1255 visuallyMaximized: true
1263 visuallyMaximized: true
1256 visible: appDelegate.x < root.width
1264 visible: appDelegate.x < root.width
@@ -1277,10 +1285,10 @@ FocusScope {
1277 PropertyChanges {
1285 PropertyChanges {
1278 target: appDelegate
1286 target: appDelegate
1279 x: stageMaths.itemX
1287 x: stageMaths.itemX
1280− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1288+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1281 z: stageMaths.itemZ
1289 z: stageMaths.itemZ
1282 requestedWidth: stageMaths.itemWidth
1290 requestedWidth: stageMaths.itemWidth
1283− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1291+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1284 visuallyMaximized: true
1292 visuallyMaximized: true
1285 visible: appDelegate.x < root.width
1293 visible: appDelegate.x < root.width
@@ -1345,9 +1353,9 @@ FocusScope {
1345 PropertyChanges {
1353 PropertyChanges {
1346 target: appDelegate
1354 target: appDelegate
1347 windowedX: root.leftMargin
1355 windowedX: root.leftMargin
1348− windowedY: PanelState.panelHeight
1356+ windowedY: panelState.panelHeight
1349 windowedWidth: (appContainer.width - root.leftMargin)/2
1357 windowedWidth: (appContainer.width - root.leftMargin)/2
1350− windowedHeight: appContainer.height - PanelState.panelHeight
1358+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1364,9 +1372,9 @@ FocusScope {
1364 PropertyChanges {
1372 PropertyChanges {
1365 target: appDelegate
1373 target: appDelegate
1366 windowedX: root.leftMargin
1374 windowedX: root.leftMargin
1367− windowedY: PanelState.panelHeight
1375+ windowedY: panelState.panelHeight
1368 windowedWidth: (appContainer.width - root.leftMargin)/2
1376 windowedWidth: (appContainer.width - root.leftMargin)/2
1369− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1377+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1383,7 +1391,7 @@ FocusScope {
1383 PropertyChanges {
1391 PropertyChanges {
1384 target: appDelegate
1392 target: appDelegate
1385 windowedX: root.leftMargin
1393 windowedX: root.leftMargin
1386− windowedY: (appContainer.height + PanelState.panelHeight)/2
1394+ windowedY: (appContainer.height + panelState.panelHeight)/2
1387 windowedWidth: (appContainer.width - root.leftMargin)/2
1395 windowedWidth: (appContainer.width - root.leftMargin)/2
1388 windowedHeight: appContainer.height/2
1396 windowedHeight: appContainer.height/2
@@ -1405,8 +1413,8 @@ FocusScope {
1406 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1414 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1407 extend: "normal"
1415 extend: "normal"
1408− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1416+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1409− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1417+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1412 name: "minimized"; when: appDelegate.minimized
1420 name: "minimized"; when: appDelegate.minimized
@@ -1505,7 +1513,7 @@ FocusScope {
1507 Binding {
1515 Binding {
1508− target: PanelState
1516+ target: panelState
1509 property: "decorationsAlwaysVisible"
1517 property: "decorationsAlwaysVisible"
1510 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1518 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1520,7 +1528,7 @@ FocusScope {
1520 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1528 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1522 target: appDelegate
1530 target: appDelegate
1523− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1531+ minimumY: panelState.panelHeight // disallow resizing up past Panel
1524 minWidth: units.gu(10)
1532 minWidth: units.gu(10)
1525 minHeight: units.gu(10)
1533 minHeight: units.gu(10)
1526 borderThickness: units.gu(2)
1534 borderThickness: units.gu(2)
@@ -1550,6 +1558,7 @@ FocusScope {
1550 highlightSize: windowInfoItem.iconMargin / 2
1558 highlightSize: windowInfoItem.iconMargin / 2
1551 stageWidth: appContainer.width
1559 stageWidth: appContainer.width
1552 stageHeight: appContainer.height
1560 stageHeight: appContainer.height
1561+ panelState: root.panelState
1554 requestedWidth: appDelegate.requestedWidth
1563 requestedWidth: appDelegate.requestedWidth
1555 requestedHeight: appDelegate.requestedHeight
1564 requestedHeight: appDelegate.requestedHeight
@@ -1609,6 +1618,7 @@ FocusScope {
1609 visible: enabled
1618 visible: enabled
1610 stageWidth: appContainer.width
1619 stageWidth: appContainer.width
1611 stageHeight: appContainer.height
1620 stageHeight: appContainer.height
1621+ panelState: root.panelState
1613 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1623 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1614 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
1624 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1713,6 +1723,7 @@ FocusScope {
1713 leftMargin: root.leftMargin
1723 leftMargin: root.leftMargin
1714 appContainerWidth: appContainer.width
1724 appContainerWidth: appContainer.width
1715 appContainerHeight: appContainer.height
1725 appContainerHeight: appContainer.height
1726+ panelState: root.panelState
1718 EdgeBarrier {
1729 EdgeBarrier {