Commit f8b1b7f4 authored by Michail Vourlakos's avatar Michail Vourlakos
Browse files

[aurorae] fix incorrectly disabled blur for maximized windows

when aurorae decorated windows become maximized and back to normal, after a while they all start to disable blur for their decorated maximized windows.

- bug was tracked down to aurorae fault sending empty QRegions for its maximized windows. What probably happens is that because mask FrameSvgItem enabled borders change from AllBorders to NoBorder, mask FrameSvgItem calculations can not catch up
- the new approach is lighter than the previous one and simpler as margins and enabledborders for mask framesvgitem are not changed and in the c++ side no QRegions calculations are needed at all for maximized windows
- in my system with the new code changing from normal window to maximized one feels a bit snapper
parent ad09d9cc
Pipeline #150569 passed with stage
in 26 minutes and 11 seconds
......@@ -578,21 +578,20 @@ void Decoration::updateBlur()
QRegion mask;
const QVariant maskProperty = m_item->property("decorationMask");
if (static_cast<QMetaType::Type>(maskProperty.type()) == QMetaType::QRegion) {
mask = maskProperty.value<QRegion>();
if (!mask.isNull()) {
QPoint maskOffset(-m_padding->left(), -m_padding->top());
if (clientPointer() && clientPointer()->isMaximized()) {
mask = QRect(0, 0, m_item->width(), m_item->height());
} else {
const QVariant maskProperty = m_item->property("decorationMask");
if (static_cast<QMetaType::Type>(maskProperty.type()) == QMetaType::QRegion) {
mask = maskProperty.value<QRegion>();
if (clientPointer() && !clientPointer()->isMaximized()) {
if (!mask.isNull()) {
// moving mask by 1,1 because mask size has already been adjusted to be smaller than the frame.
// Since the svg will have antialiasing and the mask not, there will be artifacts at the corners,
// if they go under the svg they're less evident.
maskOffset += QPoint(1, 1);
QPoint maskOffset(-m_padding->left()+1, -m_padding->top()+1);
mask.translate(maskOffset);
}
mask.translate(maskOffset);
}
}
......
......@@ -223,9 +223,9 @@ Decoration {
anchors.fill: parent
// This makes the mask slightly smaller than the frame. Since the svg will have antialiasing and the mask not,
// there will be artifacts at the corners, if they go under the svg they're less evident
anchors.margins: decoration.client.maximized ? 0 : 1
anchors.margins: 1
imagePath: backgroundSvg.imagePath
opacity: 0
enabledBorders: decoration.client.maximized ? PlasmaCore.FrameSvg.NoBorder : PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder
enabledBorders: PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment