Bug 487538

Summary: Buggy corners when using background blur
Product: [Plasma] kwin Reporter: Artem <stasyukartem2>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: anael, kwin-bugs-null, nate, notmart, uhhadd
Priority: NOR Keywords: wayland
Version: 6.1.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.0
Sentry Crash Report:
Attachments: Comparison of the corners with and without blur
Konsole With Blur
Konsole Wihtout Blur
Plastik window decoration

Description Artem 2024-05-25 15:54:41 UTC
Created attachment 169819 [details]
Comparison of the corners with and without blur

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
During usage of Konsole with background blur and opacity set on 30%, the top corners are getting sharp and due to KWin not having bottom rounded corners, the blur is not applying correctly on the bottom corners.

STEPS TO REPRODUCE
1. Go to Konsole settings
2. Add blur to current Konsole theme and set opacity on any percentage
3. Restart Konsole

OBSERVED RESULT

The top corners are sharp and the bottom must have rounded corners, due to rounded blur

EXPECTED RESULT

There must be no sharp top corners and the bottom corners must have blur (or KWin needs to be updated to support rounded bottom corners, as Nate graham joked in here: https://invent.kde.org/plasma/breeze/-/merge_requests/449)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux, KDE Plasma 6.1 Beta
(available in About System)
KDE Plasma Version: 6.90.0
KDE Frameworks Version: 6.2
Qt Version: 6.90.0-1

ADDITIONAL INFORMATION

Comparison of Konsole with and without blur are in the images:
Comment 1 Artem 2024-05-25 15:55:15 UTC
Created attachment 169820 [details]
Konsole With Blur
Comment 2 Artem 2024-05-25 15:55:38 UTC
Created attachment 169821 [details]
Konsole Wihtout Blur
Comment 3 Nate Graham 2024-06-14 18:21:06 UTC
Does the issue only happen in Konsole, or any other apps too?

Does the issue still happen in Konsole when using a window decoration theme that isn't Breeze?
Comment 4 Artem 2024-06-14 21:04:48 UTC
(In reply to Nate Graham from comment #3)
> Does the issue only happen in Konsole, or any other apps too?
> 
> Does the issue still happen in Konsole when using a window decoration theme
> that isn't Breeze?

Hey Nate, thanks for your answer, because only Konsole natively supports the blur protocol, yes. The context menu (right click) has no issues, because in 6.1 the issue with corners got fixed. I will check later on oxygen window decoration if it's different.
Comment 5 Artem 2024-06-14 22:34:58 UTC
(In reply to Nate Graham from comment #3)
> Does the issue only happen in Konsole, or any other apps too?
> 
> Does the issue still happen in Konsole when using a window decoration theme
> that isn't Breeze?

I have tried to use for example Plastik, and the corners there aren't buggy, the blur is not rounded.
Comment 6 Artem 2024-06-14 22:44:31 UTC
Created attachment 170510 [details]
Plastik window decoration
Comment 7 Artem 2024-06-14 22:52:37 UTC
Theoretically, what can fix this issue, is make the corners rounded, like on the top. Then the blur will be aligned correctly with the border
Comment 8 Nate Graham 2024-06-17 16:32:08 UTC
How about a window decoration theme that isn't Breeze, but also has rounded corners?
Comment 9 Artem 2024-06-19 07:48:45 UTC
(In reply to Nate Graham from comment #8)
> How about a window decoration theme that isn't Breeze, but also has rounded
> corners?

All the window decorations I have tested, had sharp corners on the bottom of the blur (the border itself was rounded) So it is only with the breeze decoration
Comment 10 Nate Graham 2024-06-19 18:46:07 UTC
But did any of them have rounded top corners like Breeze does? Can you make sure to test with some themes that have rounded top corners to see if the issue happens when them as well?
Comment 11 Artem 2024-06-19 21:29:46 UTC
(In reply to Nate Graham from comment #10)
> But did any of them have rounded top corners like Breeze does? Can you make
> sure to test with some themes that have rounded top corners to see if the
> issue happens when them as well?

Yes, they all did, I picked different window decorations: with all round corners, with only top rounded corners, with all sharp, and all were fine, but the Breeze window decoration.
Comment 12 Nate Graham 2024-06-20 14:28:44 UTC
Ok, thanks.
Comment 13 Marco Martin 2024-06-25 12:43:24 UTC
I think this is kinda the expected behavior as the blur regiorn is sent as an 1 bit bitmap, so its rounded corners are actually pixelated. we need to change slightly the protocol at least on wayland to be able to have regions with antialiased borders
Comment 14 Artem 2024-06-25 15:23:29 UTC
(In reply to Marco Martin from comment #13)
> I think this is kinda the expected behavior as the blur regiorn is sent as
> an 1 bit bitmap, so its rounded corners are actually pixelated. we need to
> change slightly the protocol at least on wayland to be able to have regions
> with antialiased borders

Thanks for your answer! Unfortunately I am not a QML/C++ developer, so can't help with it, but I think that we can make a merge request for fixing this issue.
Comment 15 Bug Janitor Service 2024-08-02 16:52:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6199
Comment 16 Zamundaaa 2024-08-06 12:34:44 UTC
Git commit 1fbb7426987da5f57da23e094a120efd8ff9b3dd by Xaver Hugl.
Committed on 06/08/2024 at 12:23.
Pushed by zamundaaa into branch 'master'.

plugins/blur: limit app-requested blur to the app surface

It does not make any sense that blur would be extended to the decoration when
the decoration doesn't request it

M  +5    -5    src/plugins/blur/blur.cpp

https://invent.kde.org/plasma/kwin/-/commit/1fbb7426987da5f57da23e094a120efd8ff9b3dd