From 73fa0d124f6b95ef5b5f11af2ed765ca003c8521 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Thu, 4 Aug 2022 15:08:22 +0300 Subject: [PATCH] effects: Fix stacking order of windows relative to panels Make windows thumbnails use their native stacking order as a 'z' value for current desktop while lowering windows from other desktops. By lowering others instead of raising current ones we get to use stacking order compatible with desktop & dock/panel window types. For now they are drawn separately, so this change doesn't do much on its own, but it would become useful during refactoring when putting all windows (regular and panel types) in a single parent with shared z stack. --- src/effects/desktopgrid/qml/DesktopView.qml | 2 +- src/effects/overview/qml/ScreenView.qml | 1 + src/effects/private/qml/WindowHeapDelegate.qml | 2 +- src/effects/windowview/qml/main.qml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/effects/desktopgrid/qml/DesktopView.qml b/src/effects/desktopgrid/qml/DesktopView.qml index 9cfbbe33e5..3aa8dc4966 100644 --- a/src/effects/desktopgrid/qml/DesktopView.qml +++ b/src/effects/desktopgrid/qml/DesktopView.qml @@ -75,9 +75,9 @@ FocusScope { wId: model.client.internalId x: model.client.x - targetScreen.geometry.x y: model.client.y - targetScreen.geometry.y + z: model.client.stackingOrder width: model.client.width height: model.client.height - z: model.client.stackingOrder opacity: model.client.dock ? desktopView.panelOpacity : 1 } } diff --git a/src/effects/overview/qml/ScreenView.qml b/src/effects/overview/qml/ScreenView.qml index 88b693aa90..12bee2ea2a 100644 --- a/src/effects/overview/qml/ScreenView.qml +++ b/src/effects/overview/qml/ScreenView.qml @@ -312,6 +312,7 @@ FocusScope { wId: model.client.internalId x: model.client.x - targetScreen.geometry.x y: model.client.y - targetScreen.geometry.y + z: model.client.stackingOrder width: model.client.width height: model.client.height opacity: container.effect.gestureInProgress diff --git a/src/effects/private/qml/WindowHeapDelegate.qml b/src/effects/private/qml/WindowHeapDelegate.qml index 82d2008c68..11b56e5f68 100644 --- a/src/effects/private/qml/WindowHeapDelegate.qml +++ b/src/effects/private/qml/WindowHeapDelegate.qml @@ -71,7 +71,7 @@ Item { visible: opacity > 0 z: activeDragHandler.active ? 1000 - : client.stackingOrder + (client.desktop === KWinComponents.Workspace.currentDesktop ? 100 : 0) + : client.stackingOrder * (client.desktop === KWinComponents.Workspace.currentDesktop ? 1 : 0.001) component TweenBehavior : Behavior { enabled: thumb.state !== "partial" && thumb.windowHeap.animationEnabled && !thumb.activeDragHandler.active diff --git a/src/effects/windowview/qml/main.qml b/src/effects/windowview/qml/main.qml index 65a2e6ff40..89be6d6567 100644 --- a/src/effects/windowview/qml/main.qml +++ b/src/effects/windowview/qml/main.qml @@ -208,6 +208,7 @@ Item { wId: model.client.internalId x: model.client.x - targetScreen.geometry.x y: model.client.y - targetScreen.geometry.y + z: model.client.stackingOrder visible: opacity > 0 opacity: (model.client.hidden || container.organized) ? 0 : 1