Don't scale WindowHeap in overview mode

when in overview mode, don't scale down WindowHeap, as this
will cause ugly glitches, but resize it down instead.
Still use transforms when it goes in desktop grid mode, at least for now

probably future further refactor can still help things

Before:

![image](/uploads/7ca83e7e9292bd8489faaf76d4c12693/image.png)

After:

![image](/uploads/27b970d056c89486661d6695d09813ff/image.png)

CCBUG:475682
This commit is contained in:
Marco Martin 2024-02-08 13:01:27 +00:00
parent 7c4bde3a32
commit 51fb56773b

View file

@ -492,14 +492,6 @@ FocusScope {
x: column * (width / columns) * gridVal
y: row * (height / rows) * gridVal
},
// Scales down the preview slighly when in Overview mode
Scale {
origin.x: width / 2
origin.y: height / 2
property real scale: Math.min(maxWidth / width, maxHeight / height)
xScale: 1 + (scale - 1) * overviewVal
yScale:1 + (scale - 1) * overviewVal
},
// Initially places transition desktops in a grid around the current one,
// and moves them slighly to avoid overlapping the UI
Translate {
@ -508,6 +500,13 @@ FocusScope {
}
]
Item {
id: backgroundArea
property real sizeAdjust: Math.min(maxWidth / parent.width, maxHeight / parent.height)
width: parent.width * (1 + (sizeAdjust - 1) * overviewVal)
height: parent.height * (1 + (sizeAdjust - 1) * overviewVal)
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
KWinComponents.DesktopBackground {
id: desktopElement
anchors.fill: parent
@ -588,17 +587,18 @@ FocusScope {
acceptedButtons: Qt.NoButton
cursorShape: dragHandler.active ? Qt.ClosedHandCursor : Qt.ArrowCursor
}
}
WindowHeap {
id: heap
width: parent.width
height: parent.height
x: 0
y: 0
width: parent.width * (1 + (backgroundArea.sizeAdjust - 1))
height: parent.height * (1 + (backgroundArea.sizeAdjust - 1))
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
function resetPosition() {
x = 0;
y = 0;
x = parent.width / 2 - width / 2;
y = parent.height / 2 - height / 2;
}
z: 9999
Drag.active: dragHandler.active
@ -683,6 +683,7 @@ FocusScope {
container.effect.deactivate();
}
}
onCurrentChanged: {
if (current) {
allDesktopHeaps.currentHeap = heap;