1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

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
This commit is contained in:
Michail Vourlakos 2020-01-30 22:01:34 +02:00
parent ebd749fd00
commit 8ab5779bcb
2 changed files with 34 additions and 26 deletions

View File

@ -295,22 +295,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();
}
@ -418,14 +408,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);

View File

@ -435,7 +435,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();
@ -445,6 +445,12 @@ Item{
}
}
Connections {
target: latteView ? latteView.visibility : null
onIsHiddenChanged: solidBackground.updateEffectsArea();
}
Connections{
target: plasmoid
onLocationChanged: solidBackground.adjustPrefix();
@ -454,17 +460,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;