Skip to content

Commit

Permalink
blur/force-blur: fix blur region for some x11 windows with csd
Browse files Browse the repository at this point in the history
  • Loading branch information
taj-ny committed Nov 9, 2024
1 parent 411567b commit e7e0e44
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,15 @@ void BlurEffect::updateBlurRegion(EffectWindow *w, bool geometryChanged)

// Don't override blur region for menus that already have one. The window geometry could include shadows.
if (shouldForceBlur(w) && !((isMenu(w) || w->isTooltip()) && (content.has_value() || geometryChanged))) {
content = w->expandedGeometry().translated(-w->x(), -w->y()).toRect();
if (m_settings.forceBlur.blurDecorations && w->decoration()) {
// On X11, EffectWindow::contentsRect() includes GTK's client-side shadows, while on Wayland, it doesn't.
// The blur region is later translated by EffectWindow::contentsRect(), causing the blur region to be too large
// on X11. To avoid this, only the frame will be blurred, regardless of whether the user enabled frame
// blurring.
const auto isX11WithCSD = effects->xcbConnection() && (w->frameGeometry() != w->bufferGeometry());
if (!isX11WithCSD) {
content = w->expandedGeometry().translated(-w->x(), -w->y()).toRect();
}
if (isX11WithCSD || (m_settings.forceBlur.blurDecorations && w->decoration())) {
frame = w->frameGeometry().translated(-w->x(), -w->y()).toRect();
}
}
Expand Down

0 comments on commit e7e0e44

Please sign in to comment.