Sliding panel doesn't hide applications

Sliding panel into its own layer.
This commit is contained in:
Pier Luigi Fiorini 2014-11-08 23:53:57 +01:00
parent ee7597de7b
commit 1d883b4d67
2 changed files with 23 additions and 23 deletions

View file

@ -25,6 +25,7 @@ import "WindowManagement.js" as WindowManagement
Rectangle { Rectangle {
property alias showSplash: splash.visible property alias showSplash: splash.visible
property bool showHome: true property bool showHome: true
property bool showPanel: true
readonly property alias layers: layers readonly property alias layers: layers
readonly property real topBarHeight: units.iconSizes.small readonly property real topBarHeight: units.iconSizes.small
readonly property real bottomBarHeight: units.iconSizes.medium readonly property real bottomBarHeight: units.iconSizes.medium
@ -57,6 +58,7 @@ Rectangle {
QtObject { QtObject {
readonly property alias desktop: desktopLayer readonly property alias desktop: desktopLayer
readonly property alias windows: windowsLayer readonly property alias windows: windowsLayer
readonly property alias panel: panelLayer
id: layers id: layers
} }
@ -75,6 +77,12 @@ Rectangle {
z: showHome ? 1 : 2 z: showHome ? 1 : 2
} }
Item {
id: panelLayer
anchors.fill: parent
z: showPanel ? 3 : 0
}
Rectangle { Rectangle {
id: bottomBar id: bottomBar
anchors.left: parent.left anchors.left: parent.left

View file

@ -156,12 +156,12 @@ function mapShellSurface(surface, child) {
var entry = surfaceModel.get(i); var entry = surfaceModel.get(i);
if (entry.surface === surface) { if (entry.surface === surface) {
// Set the appropriate z-index // Switch to layer and take focus
entry.window.z = (surface.className == "plasmashell.desktop") ? 1 : 0; if (surface.className == "plasmashell.desktop") {
compositorRoot.showPanel = true;
// Switch to the desktop layer and take focus } else {
compositorRoot.showHome = true; compositorRoot.showHome = true;
compositorRoot.currentWindow = null; }
entry.window.child.takeFocus(); entry.window.child.takeFocus();
return; return;
@ -177,20 +177,21 @@ function mapShellSurface(surface, child) {
// Create and setup window container // Create and setup window container
// XXX: We only support desktop roles for now // 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.parent = window;
window.child.touchEventsEnabled = true; window.child.touchEventsEnabled = true;
window.x = window.y = 0; window.x = window.y = 0;
window.width = surface.size.width; window.width = surface.size.width;
window.height = surface.size.height; 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 // Switch to the desktop layer and take focus
compositorRoot.showSplash = false; compositorRoot.showSplash = false;
compositorRoot.showHome = true; if (surface.className == "plasmashell.desktop") {
compositorRoot.showPanel = true;
} else {
compositorRoot.showHome = true;
}
window.child.takeFocus(); window.child.takeFocus();
// Add surface to the model // Add surface to the model
@ -208,17 +209,8 @@ function unmapApplicationSurface(surface) {
} }
function unmapShellSurface(surface) { function unmapShellSurface(surface) {
// Lower unmapped shell surfaces not handled by the protocol // Hide panel layer if this is the sliding panel
// (i.e. not home screen like sliding window)
if (surface.className == "plasmashell.desktop") { if (surface.className == "plasmashell.desktop") {
var i; compositorRoot.showPanel = false;
for (i = 0; i < surfaceModel.count; i++) {
var entry = surfaceModel.get(i);
if (entry.surface === surface) {
entry.window.z = -1;
return;
}
}
} }
} }