effects/blur: Ignore xshape region
EffectWindow::shape() doesn't fit the item based design. This change ports the blur effect away from the shape() function to the rect() function. The XShape extension was introduced when windows with an alpha channel wasn't really a thing. Setting a shape served as a way to clip a window, the most notable example is xeyes. If an application relies on the xshape extension to actually clip the window and not to force the window manager not to put the server-side deco, it most likely doesn't support translucency and therefore it shouldn't set the blur region to begin with. This change makes the blur effect ignore the xshape region similar to the background contrast effect. It allows us to decouple a bit more effects from the rest of rendering machinery and thus make it easier for us to move forward with the scene redesign goal.
This commit is contained in:
parent
c1aa1c6c09
commit
de3b7a96db
1 changed files with 3 additions and 5 deletions
|
@ -404,21 +404,19 @@ QRegion BlurEffect::blurRegion(const EffectWindow *w) const
|
|||
const QRegion appRegion = qvariant_cast<QRegion>(value);
|
||||
if (!appRegion.isEmpty()) {
|
||||
if (w->decorationHasAlpha() && effects->decorationSupportsBlurBehind()) {
|
||||
region = w->shape() & w->rect();
|
||||
region -= w->decorationInnerRect();
|
||||
region = QRegion(w->rect()) - w->decorationInnerRect();
|
||||
}
|
||||
region |= appRegion.translated(w->contentsRect().topLeft()) &
|
||||
w->decorationInnerRect();
|
||||
} else {
|
||||
// An empty region means that the blur effect should be enabled
|
||||
// for the whole window.
|
||||
region = w->shape() & w->rect();
|
||||
region = w->rect();
|
||||
}
|
||||
} else if (w->decorationHasAlpha() && effects->decorationSupportsBlurBehind()) {
|
||||
// If the client hasn't specified a blur region, we'll only enable
|
||||
// the effect behind the decoration.
|
||||
region = w->shape() & w->rect();
|
||||
region -= w->decorationInnerRect();
|
||||
region = QRegion(w->rect()) - w->decorationInnerRect();
|
||||
}
|
||||
|
||||
return region;
|
||||
|
|
Loading…
Reference in a new issue