Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blur/force-blur: fix blur region for some x11 windows with csd #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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