diff --git a/compositor/contents/Compositor.qml b/compositor/contents/Compositor.qml index c0749f51..37716dfb 100644 --- a/compositor/contents/Compositor.qml +++ b/compositor/contents/Compositor.qml @@ -25,6 +25,7 @@ import "WindowManagement.js" as WindowManagement Rectangle { property alias showSplash: splash.visible property bool showHome: true + property bool showPanel: true readonly property alias layers: layers readonly property real topBarHeight: units.iconSizes.small readonly property real bottomBarHeight: units.iconSizes.medium @@ -57,6 +58,7 @@ Rectangle { QtObject { readonly property alias desktop: desktopLayer readonly property alias windows: windowsLayer + readonly property alias panel: panelLayer id: layers } @@ -75,6 +77,12 @@ Rectangle { z: showHome ? 1 : 2 } + Item { + id: panelLayer + anchors.fill: parent + z: showPanel ? 3 : 0 + } + Rectangle { id: bottomBar anchors.left: parent.left diff --git a/compositor/contents/WindowManagement.js b/compositor/contents/WindowManagement.js index 136f0eaf..a456e1fd 100644 --- a/compositor/contents/WindowManagement.js +++ b/compositor/contents/WindowManagement.js @@ -156,12 +156,12 @@ function mapShellSurface(surface, child) { var entry = surfaceModel.get(i); if (entry.surface === surface) { - // Set the appropriate z-index - entry.window.z = (surface.className == "plasmashell.desktop") ? 1 : 0; - - // Switch to the desktop layer and take focus - compositorRoot.showHome = true; - compositorRoot.currentWindow = null; + // Switch to layer and take focus + if (surface.className == "plasmashell.desktop") { + compositorRoot.showPanel = true; + } else { + compositorRoot.showHome = true; + } entry.window.child.takeFocus(); return; @@ -177,20 +177,21 @@ function mapShellSurface(surface, child) { // Create and setup window container // XXX: We only support desktop roles for now - var window = component.createObject(compositorRoot.layers.desktop, {"child": child}); + var window = component.createObject(compositorRoot, {"child": child}); + window.parent = (surface.className == "plasmashell.desktop") ? compositorRoot.layers.panel : compositorRoot.layers.desktop; window.child.parent = window; window.child.touchEventsEnabled = true; window.x = window.y = 0; window.width = surface.size.width; window.height = surface.size.height; - // Set a higher z-index to windows created by the shell but - // not handled by the protocol (i.e. not home screen) - window.z = (surface.className == "plasmashell.desktop") ? 1 : 0; - // Switch to the desktop layer and take focus compositorRoot.showSplash = false; - compositorRoot.showHome = true; + if (surface.className == "plasmashell.desktop") { + compositorRoot.showPanel = true; + } else { + compositorRoot.showHome = true; + } window.child.takeFocus(); // Add surface to the model @@ -208,17 +209,8 @@ function unmapApplicationSurface(surface) { } function unmapShellSurface(surface) { - // Lower unmapped shell surfaces not handled by the protocol - // (i.e. not home screen like sliding window) + // Hide panel layer if this is the sliding panel if (surface.className == "plasmashell.desktop") { - var i; - for (i = 0; i < surfaceModel.count; i++) { - var entry = surfaceModel.get(i); - - if (entry.surface === surface) { - entry.window.z = -1; - return; - } - } + compositorRoot.showPanel = false; } }