Bug 501243

Summary: Fullscreen operation of surface that doesn't cover whole output breaks when not in direct scanout
Product: [Plasma] kwin Reporter: Oleg <oleg>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version First Reported In: 6.3.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Wrong surface handling when direct scanout is not engaged

Description Oleg 2025-03-08 23:12:54 UTC
SUMMARY
According to xdg-shell protocol if the surface doesn't cover the whole output, the compositor will position the surface in the center of the output and compensate with border fill covering the rest of the output. In KWin it's only work when direct scanout is engaged. When direct scanout doesn't work (HDR, cursor drawing) KWin puts surface to the left side of the output and doesn't fill borders with anything.

STEPS TO REPRODUCE
1. Make sure direct scanout won't engage
2. Launch any SDL3 (or SDL2 with sdl2-compat installed) application with next environment variables: SDL_VIDEO_DRIVER=wayland SDL_VIDEO_WAYLAND_MODE_SCALING=aspect
3. Set resolution with aspect ratio different from output's

OBSERVED RESULT
Surface would be moved to the left side of the output and borders won't be filled with anything

EXPECTED RESULT
Surface should be treated just like with direct scanout.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.6-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
Memory: 62.5 ГиБ of RAM
Graphics Processor: AMD Radeon RX 6700 XT
Manufacturer: ASUS
Comment 1 Oleg 2025-03-08 23:14:54 UTC
Created attachment 179239 [details]
Wrong surface handling when direct scanout is not engaged
Comment 2 Zamundaaa 2025-03-10 12:08:15 UTC

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