compute blur area correctly on startup

--improve calculations for Effects area during startup
and at the same time when the dock is totally hidden
so it should not paint any effects area at all.

BUG:416928
FIXED-IN:0.9.9
pull/16/head
Michail Vourlakos 5 years ago
parent 3bf3141614
commit b11dacc004

@ -294,22 +294,12 @@ QRect Effects::rect() const
void Effects::setRect(QRect area)
{
if (KWindowSystem::compositingActive()) {
QRect inWindowRect = area.intersected(QRect(0, 0, m_view->width(), m_view->height()));
if (m_rect == inWindowRect) {
return;
}
m_rect = inWindowRect;
} else {
if (m_rect == area) {
return;
}
m_rect = area;
if (m_rect == area) {
return;
}
m_rect = area;
emit rectChanged();
}
@ -417,14 +407,19 @@ void Effects::updateEffects()
m_background->setImagePath(QStringLiteral("widgets/panel-background"));
}
QRect inWindowRect = m_rect;
if (KWindowSystem::compositingActive()) {
inWindowRect = m_rect.intersected(QRect(0, 0, m_view->width(), m_view->height()));
}
m_background->setEnabledBorders(m_enabledBorders);
m_background->resizeFrame(m_rect.size());
m_background->resizeFrame(inWindowRect.size());
QRegion fixedMask = m_background->mask();
fixedMask.translate(m_rect.x(), m_rect.y());
fixedMask.translate(inWindowRect.x(), inWindowRect.y());
//! fix1, for KF5.32 that return empty QRegion's for the mask
if (fixedMask.isEmpty()) {
fixedMask = QRegion(m_rect);
fixedMask = QRegion(inWindowRect);
}
KWindowEffects::enableBlurBehind(m_view->winId(), true, fixedMask);

@ -402,7 +402,7 @@ Item{
//! Fix for FrameSvgItem QML version not updating its margins after a theme change
//! with this hack we enforce such update. I could use the repaintNeeded signal but
//! it is called more often than the themeChanged one.
Connections{
Connections {
target: themeExtended
onThemeChanged: {
solidBackground.adjustPrefix();
@ -412,6 +412,12 @@ Item{
}
}
Connections {
target: latteView ? latteView.visibility : null
onIsHiddenChanged: solidBackground.updateEffectsArea();
}
Connections{
target: plasmoid
onLocationChanged: solidBackground.adjustPrefix();
@ -421,17 +427,24 @@ Item{
if (!latteView)
return;
if (!root.behaveAsPlasmaPanel) {
var rootGeometry = mapToItem(root, 0, 0);
efGeometry.x = rootGeometry.x;
efGeometry.y = rootGeometry.y;
} else {
if (latteView.visibility.isHidden) {
efGeometry.x = 0;
efGeometry.y = 0;
}
efGeometry.width = 0;
efGeometry.height = 0;
} else {
if (!root.behaveAsPlasmaPanel) {
var rootGeometry = mapToItem(root, 0, 0);
efGeometry.x = rootGeometry.x;
efGeometry.y = rootGeometry.y;
} else {
efGeometry.x = 0;
efGeometry.y = 0;
}
efGeometry.width = width;
efGeometry.height = height;
efGeometry.width = width;
efGeometry.height = height;
}
latteView.effects.rect = efGeometry;

Loading…
Cancel
Save