taj-ny / kwin-effects-forceblur

Blur any window on KDE Plasma 6
GNU General Public License v3.0
107 stars 7 forks source link

Blur radius is incorrect for floating panels #78

Open talentlessguy opened 2 weeks ago

talentlessguy commented 2 weeks ago

image

image

I have my corner blur radius set to 16px in Force Blur settings

taj-ny commented 2 weeks ago

On the first picture it looks like an issue with the shadow and not the blur. I believe it's an issue with the theme you're using. Panel Colorizer allows you to set the panel radius, although I haven't tested it with blur.

luisbocanegra commented 2 weeks ago

I have added custom blur mask to Panel Colorizer (not released yet), while it works:

image

The curves are not perfect, do you happen to know why it does that?

Screenshot_20240612_202024

Initially I thought about asking if your effect could provide custom rounded corner for the panel, but I also wanted blurred widgets and the panel mask allowed me to do that (panel: https://github.com/luisbocanegra/plasma-panel-colorizer/commit/d7713be982b33b53f078c94d9c69996a093c82a5 widgets: https://github.com/luisbocanegra/plasma-panel-colorizer/commit/9f312d8c31e6f8ba5e87c3d31640d3f23ce53d11) but I am afraid this as much as I can do with my limited C++/KWin/Graphics knowledge. Is this something that I should fix, some limitation of the effects (also happens with the contrast) if the second, do you know if reporting that could be actionable from the Plasma devs perspective or is also the reason you're making your own effect?

Also. For me your effect applies the blur beyond the panel background when Blur Docks is enabled, probably because that's actually the full panel geometry or the shadow?

Screenshot_20240612_205030

taj-ny commented 2 weeks ago

The curves are not perfect, do you happen to know why it does that?

I don't know, I think Qt is just bad at drawing circles. I currently use a different method to round the corners, but it looks the same as yours. LightlyShaders has slightly better-looking corners, although they're still not perfect. I've managed to achieve perfect corners (even without antialiasing) by generating the masks with OpenGL.

I think the best solution would be to bundle pregenerated corners as images like the one below and convert them to QRegions. I used GIMP to make that one but it looks the same as the OpenGL one. image

Also. For me your effect applies the blur beyond the panel background when Blur Docks is enabled, probably because that's actually the full panel geometry or the shadow?

Yes, that's the actual panel geometry. There's an invisible border (which may also contain shadows) but it belongs to the panel window.

luisbocanegra commented 2 weeks ago

The curves are not perfect, do you happen to know why it does that?

I don't know, I think Qt is just bad at drawing circles. I currently use a different method to round the corners, but it looks the same as yours. LightlyShaders has slightly better-looking corners, although they're still not perfect. I've managed to achieve perfect corners (even without antialiasing) by generating the masks with OpenGL.

Thanks for the detailed response. Will try to learn from your implementation to see if the same can be done with the panel.

Also managed to build better-rounded-corners branch on Plasma 6.2 Dev after applying these patches:

Will be testing it with KDE Rounded Corners border disabled and let you know if I have any feedback.

talentlessguy commented 2 weeks ago

I believe it's an issue with the theme you're using.

what exactly is wrong with the theme? incorrect radius of the panel, or incorrect shadows?

taj-ny commented 2 weeks ago

what exactly is wrong with the theme? incorrect radius of the panel, or incorrect shadows?

The shadows. I think they either belong to the panel background SVG or are painted by Plasma based on the background mask provided by the theme. I haven't looked at the implementation so I may be wrong though.

Blur may also be an issue, although it's not visible due to the wallpaper. The blur region depends on the background mask, so it's the theme's responsibility to provide a rounded mask. The effect currently doesn't round panels correctly as the blur region is smaller than the window. I'll add an exception for panels.