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 breaks with plasma 5.25 #64

Open
nicman23 opened this issue Aug 15, 2022 · 7 comments
Open

Blur breaks with plasma 5.25 #64

nicman23 opened this issue Aug 15, 2022 · 7 comments

Comments

@nicman23
Copy link

I run this with kvantum and while windows are properly blurred their decoration isn't

example:

image
image

@tejasraman
Copy link

Same here. @Zren is there a fix?

@nicman23
Copy link
Author

@Zren fixed it nicman23@16ac01a

@tejasraman
Copy link

@nicman23 It works fine on my Plasma system with your fork. Thanks!

@K4in-5037
Copy link

K4in-5037 commented Jan 15, 2023

I found this issue after trying to get blurred decorations not knowing it was a bug, it may not be immediately noticeable because some windows can set explicitly its blur and it forces the decoration to be blurred too, as it happens with konsole or when using the "force blur" kwin script, but even then is glitchy.

I couldn't build @nicman23 fork but I made a patch out of his changes for last commit 4784647

--- a/src/Decoration.cc	2023-01-12 23:37:53.407256227 -0600
+++ b/src/Decoration.cc	2023-01-12 23:37:16.340695505 -0600
@@ -200,6 +200,7 @@ void Decoration::paint(QPainter *painter, const QRect &repaintRegion)
     if (settings()->borderSize() >= KDecoration2::BorderSize::Normal) {
         paintOutline(painter, repaintRegion);
     }
+    setBlurRegion( QRegion(this->titleBar()) );
 }
 
 void Decoration::init()
@@ -319,7 +320,7 @@ void Decoration::hoverEnterEvent(QHoverEvent *event)
 {
     KDecoration2::Decoration::hoverEnterEvent(event);
     qCDebug(category) << "Decoration::hoverEnterEvent" << event;
-
+    setBlurRegion( QRegion(this->titleBar()) );
     // m_menuButtons->setHovered(true);
 }
 
@@ -345,6 +346,7 @@ void Decoration::hoverMoveEvent(QHoverEvent *event)
     // } else if (wasHovered && contains) {
     //     // HoverMove
     // }
+    setBlurRegion( QRegion(this->titleBar()) );
 }
 
 void Decoration::mouseReleaseEvent(QMouseEvent *event)
@@ -353,6 +355,7 @@ Decoration::mouseReleaseEvent(QMouseEvent *event)
     // qCDebug(category) << "Decoration::mouseReleaseEvent" << event;
 
     resetDragMove();
+    setBlurRegion( QRegion(this->titleBar()) );
 }
 
 void Decoration::hoverLeaveEvent(QHoverEvent *event)
@@ -361,7 +364,7 @@ void Decoration::hoverLeaveEvent(QHoverEvent *event)
     qCDebug(category) << "Decoration::hoverLeaveEvent" << event;
 
     resetDragMove();
-
+    setBlurRegion( QRegion(this->titleBar()) );
     // m_menuButtons->setHovered(false);
 }

@Zren This indeed fixed the blur.

@Zren
Copy link
Owner

Zren commented Jan 15, 2023

Hmm, I need to check if the frame left/bottom/right is transparent blurred and make sure that works too. I always use no borders though so I can see it not being tested.

SierraBreezeEnhaced and Klassy uses:

setBlurRegion( QRegion( m_windowPath->toFillPolygon().toPolygon()) ) ;

Zren added a commit that referenced this issue Jan 15, 2023
Move setBlurRegion to own updateBlur function.
Change region to entire decoration frame size to blur the frame too.
Check for Plasma 5.25 for setBlurRegion.
Add QRegion import.
@Zren
Copy link
Owner

Zren commented Jan 15, 2023

I moved the setBlurRegion() calls to it's own function. I also changed the region to:

void Decoration::updateBlur()
{
#if HAVE_KDecoration2_5_25
    setBlurRegion(QRegion(0, 0, size().width(), size().height()));
#endif
}

Which seem to blur fine. Not sure why the outline is offset though. Need to test on a non busted GPU.

2023-01-15___03-50-13

@K4in-5037
Copy link

@Zren you were right, I had no borders set and didn't noticed the Left/Right/Bottom borders

Screenshot_20230115_085226

Using setBlurRegion(QRegion(0, 0, size().width(), size().height()));

Screenshot_20230115_085357

Applies blur to all sides.

I've got that weird outline too before and after, this is on an old Intel HD 5500 GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants