mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Sliding panel doesn't hide applications
Sliding panel into its own layer.
This commit is contained in:
parent
ee7597de7b
commit
1d883b4d67
2 changed files with 23 additions and 23 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue