Bug 500185 - Moving windows with no shadows/wobbly windows effect leaves artifacts behind
Summary: Moving windows with no shadows/wobbly windows effect leaves artifacts behind
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (other bugs)
Version First Reported In: 6.3.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-16 13:52 UTC by Andrzej Rybczak
Modified: 2025-05-21 20:02 UTC (History)
2 users (show)

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


Attachments
Demonstration of artifacts after disabling shadows (1.94 MB, video/webm)
2025-02-16 13:52 UTC, Andrzej Rybczak
Details
Demonstration with no shadows and with/without wobbly windows (2.01 MB, video/webm)
2025-02-19 00:53 UTC, Andrzej Rybczak
Details
Patch that doesn't work (replaces all toRect occurrences with toAlignedRect) (43.13 KB, patch)
2025-03-24 00:31 UTC, Andrzej Rybczak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej Rybczak 2025-02-16 13:52:36 UTC
Created attachment 178437 [details]
Demonstration of artifacts after disabling shadows

SUMMARY

When window shadows and wobbly windows effect are disabled, moving windows around leaves vertical and/or horizontal bars around (see the attachment for demonstration).

STEPS TO REPRODUCE
1. Use a Wayland session (this doesn't happen in X11).
2. Go to Desktop Effects and disable wobbly windows.
3. Go to Window Decorations and disable shadows.
4. Move any window around.

OBSERVED RESULT

Vertical and/or horizontal bars left behind.

EXPECTED RESULT

No artifacts.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.13.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION

The recording is from my desktop. I also observed this on my laptop with integrated Intel graphics, but it's very hard to trigger there for some reason.
Comment 1 Bug Janitor Service 2025-02-18 11:58:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7182
Comment 2 Vlad Zahorodnii 2025-02-18 12:21:58 UTC
Git commit 8daa0aec818d623c6067a528320b4599c63298e9 by Vlad Zahorodnii.
Committed on 18/02/2025 at 12:08.
Pushed by vladz into branch 'master'.

plugins/wobblywindows: Use .toAlignedRect() instead of .toRect()

.toRect() doesn't work by rounding left/top/right/bottom edge coordinates.
.toAlignedRect() is better suited for computing repaint regions.

CCBUG because I can't reproduce the bug.

M  +1    -1    src/plugins/wobblywindows/wobblywindows.cpp

https://invent.kde.org/plasma/kwin/-/commit/8daa0aec818d623c6067a528320b4599c63298e9
Comment 3 Bug Janitor Service 2025-02-18 12:23:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7184
Comment 4 Vlad Zahorodnii 2025-02-18 13:12:46 UTC
Git commit 3974a3de81c6091b0d6d1e06fe64932b279e87e8 by Vlad Zahorodnii.
Committed on 18/02/2025 at 12:23.
Pushed by vladz into branch 'Plasma/6.3'.

plugins/wobblywindows: Use .toAlignedRect() instead of .toRect()

.toRect() doesn't work by rounding left/top/right/bottom edge coordinates.
.toAlignedRect() is better suited for computing repaint regions.

CCBUG because I can't reproduce the bug.


(cherry picked from commit 8daa0aec818d623c6067a528320b4599c63298e9)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +1    -1    src/plugins/wobblywindows/wobblywindows.cpp

https://invent.kde.org/plasma/kwin/-/commit/3974a3de81c6091b0d6d1e06fe64932b279e87e8
Comment 5 Nate Graham 2025-02-18 15:11:41 UTC
I can't reproduce the issue with those commits applied, so it looks like they fixed it!
Comment 6 Andrzej Rybczak 2025-02-19 00:40:58 UTC
I updated to 6.3.1 and unfortunately nothing has changed, it still happens.

It's also not clear to me why mentioned commit would fix this. As I indicated in the description, this happens when wobbly windows are disabled. Enabling either wobbly windows OR shadows makes the artifacts disappear.
Comment 7 Andrzej Rybczak 2025-02-19 00:53:16 UTC
Created attachment 178560 [details]
Demonstration with no shadows and with/without wobbly windows
Comment 8 Vlad Zahorodnii 2025-02-19 11:09:42 UTC
(In reply to Andrzej Rybczak from comment #6)
> I updated to 6.3.1 and unfortunately nothing has changed, it still happens.
> 
> It's also not clear to me why mentioned commit would fix this. As I
> indicated in the description, this happens when wobbly windows are disabled.
> Enabling either wobbly windows OR shadows makes the artifacts disappear.

I misread the comment. In either case, I am still unable to reproduce the bug.
Comment 9 Andrzej Rybczak 2025-02-19 12:25:03 UTC
This is unfortunate :(

FWIW this happens here with the default starting plasma configuration (on a clear user account) as soon as I disable window shadows (since wobbly windows are not enabled by default). But yeah, I can't easily reproduce this on my laptop with Intel graphics, maybe this is consistently reproducible with amdgpu only?

In any case, it's weird. It looks like kwin is repainting a tad too little region when moving windows around (and presumably enabling shadows increases the repaint region because of the shadows, that's why it fixes the problem). I can experiment locally with potential patches if you have any ideas.
Comment 10 Andrzej Rybczak 2025-03-24 00:31:30 UTC
Created attachment 179686 [details]
Patch that doesn't work (replaces all toRect occurrences with toAlignedRect)

FYI, I tried this patch and it does NOT fix the problem, so the issues lies elsewhere.
Comment 11 Andrzej Rybczak 2025-04-02 12:38:04 UTC
(In reply to Vlad Zahorodnii from comment #8)
> (In reply to Andrzej Rybczak from comment #6)
> > I updated to 6.3.1 and unfortunately nothing has changed, it still happens.
> > 
> > It's also not clear to me why mentioned commit would fix this. As I
> > indicated in the description, this happens when wobbly windows are disabled.
> > Enabling either wobbly windows OR shadows makes the artifacts disappear.
> 
> I misread the comment. In either case, I am still unable to reproduce the
> bug.

This seems to be also related to fractional scaling. I couldn't reproduce this easily on my laptop, but if I set scaling to 115%, then it's reproducible on both my desktop and laptop even with shadows enabled.

Can you try it and see if it's reproducible at your end this way?
Comment 12 Andrzej Rybczak 2025-04-23 13:47:14 UTC
I can no longer reproduce it, it stopped happening after one of the system updates (I think one that updated qt6, but not sure).
Comment 13 Mattech 2025-05-21 20:02:16 UTC
Issue is still present in 6.3.5. My forum post here, which also has a screenshot with the issue happening, along with my specs and version #

https://discuss.kde.org/t/graphical-issue-in-kde-plasma-when-sliding-windows/34520

Or direct image here: https://imgur.com/a/kk6rjW3

Using the "Plastic" window decoration that KDE/CachyOS ships with, causes the graphical lines on the desktop, and also causes the whole computer to lag for a quarter second or so when opening a new KDE window. Going back to the default Breeze decoration fixes these issues.

Also, turning off shadows causes the graphical issues as well, when sliding the windows around the desktop. Turning shadows back on resolves this.

Operating System: CachyOS (Arch)
KDE Plasma Version: 6.3.5
KDE Frameworks Version:
Qt Version:
Kernel Version: 6.14.6-2
Graphics Platform: Wayland
Processors: AMD 5900x
Memory: 32 GB
Graphics Processor 1: nVidia 3090
Graphics Processor 2:
Manufacturer: nVidia
Product Name:
System Version: