Bug 477454 - Root background damage regions are calculated incorrectly with multiscreen
Summary: Root background damage regions are calculated incorrectly with multiscreen
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.27.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2023-11-24 09:34 UTC by Asahi Lina
Modified: 2024-07-29 21:58 UTC (History)
3 users (show)

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


Attachments
Screenshot of the issue (2.83 MB, image/png)
2023-11-24 09:34 UTC, Asahi Lina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Asahi Lina 2023-11-24 09:34:43 UTC
Created attachment 163418 [details]
Screenshot of the issue

SUMMARY

With kwin_wayland multiscreen and no root window (no plasmashell), the black background on screens not at the (0,0) origin is not repainted properly when damaged.

STEPS TO REPRODUCE
1. Configure multiple screens
2. killall plasmashell
3. Move things around (or just the mouse cursor if using software cursors)

OBSERVED RESULT
See attachment. It looks like the damage/repaint region for the black background is calculated incorrectly, and the background render happens at the wrong output coordinates within the framebuffer. Moving the mouse cursor causes black trails at the offset position on top of other window content (though I couldn't grab a screenshot of this). On the screenshot you can see that only the right band of the background is cleared to black. This is because the repaints are offset by the width of the leftmost screen (which is less wide than the rightmost screen).

If there are two screens with dimensions 100x100 and 200x200 placed left to right in that order, top-aligned, then background damage at offset (0,0) in the rightmost screen, which is at (100,0) in absolute coordinates, gets repainted at (100,0) *relative to the rightmost screen*, which is (200,0) in absolute coordinates. Then the region at (100,0) is missing the background repaint, so whatever damaged that region just paints on top of the stray/damaged framebuffer (leading to cursor trails and the like), while the region at (200,0) gets clobbered with black even if there is some other window on top.

EXPECTED RESULT
Correct rendering

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux Asahi Remix 39
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.6.0-asahi-00861-g9b58b16aa50d (64-bit)
Graphics Platform: Wayland
Processors: 12
Memory: 54.5 GiB of RAM
Graphics Processor: Apple M2 Max
Product Name: Apple MacBook Pro (16-inch, M2 Max, 2023)