Bug 492485 - Breeze window decoration outline causes gap in window snapping with fractional scale factors.
Summary: Breeze window decoration outline causes gap in window snapping with fractiona...
Status: RESOLVED DUPLICATE of bug 485060
Alias: None
Product: Breeze
Classification: Plasma
Component: window decoration (show other bugs)
Version: 6.1.4
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-01 10:42 UTC by Ye Jingchen
Modified: 2024-11-06 21:06 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kwrite surrounded by firefox (64.30 KB, image/avif)
2024-09-01 10:42 UTC, Ye Jingchen
Details
firefox and three dolphins (33.44 KB, image/avif)
2024-09-01 10:44 UTC, Ye Jingchen
Details
Plasma 6.2 at 200% scaling (98.67 KB, image/webp)
2024-09-13 12:58 UTC, Ye Jingchen
Details
Plasma 6.2 at 175% scaling (108.66 KB, image/webp)
2024-09-13 13:06 UTC, Ye Jingchen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ye Jingchen 2024-09-01 10:42:28 UTC
Created attachment 173192 [details]
kwrite surrounded by firefox

SUMMARY
With outline enabled, snapping windows (with breeze decoration, of course) together always leaves a gap on the right side and lower side, but not on the upper side and left side. If one of the windows is not using server side decoration, then the gap is only visible closer to the breeze decorated window.

STEPS TO REPRODUCE
1. Enabled breeze outline in System Settings -> Colors & Themes -> Window Decorations -> Breeze -> Edit Breeze Theme -> Shadows and Outline, set Outline intensity to anything other than Off. Optionally disable shadow here, to make things easier to recognize.
2. Open multiple KWrite windows, or other app using server side decoration.
3. Try snapping them together in varies direction.

OBSERVED RESULT
The breeze decorated window leaves a gap on the right and lower side. The gap size seems to be related to scaling factor: On my 200% screen the gap is 2px wide, but only 1px on 150% screen.

EXPECTED RESULT
Snapped windows should leaves no gap with outline enabled.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 6850HS with Radeon Graphics
Memory: 14.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
Comment 1 Ye Jingchen 2024-09-01 10:44:25 UTC
Created attachment 173193 [details]
firefox and three dolphins

Another show case of gaps
Comment 2 Nate Graham 2024-09-05 20:43:19 UTC
I'm having a hard time reproducing this on git master, with a 225% scale screen.

Would you be able to attach a screen recording that shows it happening?
Comment 3 Ye Jingchen 2024-09-06 14:06:13 UTC
(In reply to Nate Graham from comment #2)
> I'm having a hard time reproducing this on git master, with a 225% scale
> screen.
> 
> Would you be able to attach a screen recording that shows it happening?

https://youtu.be/GrDoHvfBbLI
I recorded the behavior on a 200% scaled monitor, with window shadow disabled for clarity.

I also tried 225% scaling factor, but the gap is also there.
Comment 4 Ye Jingchen 2024-09-13 12:58:36 UTC
Created attachment 173617 [details]
Plasma 6.2 at 200% scaling

I tried the new Plasma 6.2 beta in a VM, no more gaps in 100% or 200% scaling!
But gaps still exists in some scaling factors like 150% and 175%, so I guess the bug is (unintentionally) fixed solved but it leaves some rounding issues.
Comment 5 Ye Jingchen 2024-09-13 13:06:56 UTC
Created attachment 173618 [details]
Plasma 6.2 at 175% scaling

Notice horizontal gap between the left and lower dolphin,  how outline in different windows have different width, and outline of different width within the same window. Actually the outline width changes when resizing windows.

I am not sure if this is the same problem as the wider gap as I originally reported, or an unrelated problem.
Comment 6 Nate Graham 2024-09-16 15:56:00 UTC
Thanks a lot! Does this seem fixable, Akseli?
Comment 7 Akseli Lahtinen 2024-09-17 11:55:51 UTC
Ah this problem. I've seen it too, it's a side effect for having to play around the gap that would appear without my change to this part of the code.

What I think is happening is that the outline is 3px wide (with antialiasing), but due to the gap issue it's trying to work around, it gets moved slightly under the window and only the antialiased part of the outline is showing.

I think the fix for this needs Kwin fractional scaling v2 changes that we have chatted some long time ago, but I do not really understand that side, so I don't know how to further aid with this.

If we can get that outline gap bug fixed, we dont need the workaround anymore and this should be fixed with removing the workaround. If we remove the workaround *now* we'll get the gaps between window and it's outline.

And yeah, it's messy. :')
Comment 8 Nate Graham 2024-11-06 21:03:48 UTC
*** Bug 494309 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2024-11-06 21:06:40 UTC

*** This bug has been marked as a duplicate of bug 485060 ***