Bug 511612

Summary: Wrong window borders if application is not constantly rendering
Product: [Plasma] kwin Reporter: Bartosz Taudul <wolf>
Component: decorationsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version First Reported In: 6.5.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Illustration of the issue

Description Bartosz Taudul 2025-11-04 11:52:11 UTC
Created attachment 186482 [details]
Illustration of the issue

SUMMARY
The window decorations (server side) do not accurately represent the actual window state. There is a one-frame lag for the window outline updates. Note that this one-frame lag is controlled not by kwin, but by the application. The application may not need to render the window contents, in which case the effects of the lag are seen for extended periods of time.


STEPS TO REPRODUCE
0. It may be necessary to have the window borders visible via a color theme.
1. Build https://github.com/wolfpld/moderncore
2. Run iv
3. Switch between the iv window and any other window and observe iv window borders.


OBSERVED RESULT
See the attached image. There are two versions of the application there, "A" renders only when it needs to do so. "B" renders constantly.

Window "1" is when the application is doing a render loop (playing an image loading animation) and then stops. All looks fine there.

Windows "2" and "4" show how the window border looks after switching the focus to the window.

Windows "3" and "5" show how the window border looks after switching the focus away from the window.


EXPECTED RESULT
Code versions "A" and "B" should behave the same.


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.5-arch1-1 (64-bit)
Graphics Platform: Wayland


ADDITIONAL INFORMATION
The difference between the "A" and "B" code versions is in Viewport::Render() function, where the m_render early exit was commented out for the "B" version.
Comment 1 Zamundaaa 2025-11-06 14:42:45 UTC
Applications must react to configure events in a timely manner and then commit the surface (rendering if necessary) for things to work correctly, as decoration state changes are synchronized to the window configuration (most important with resizing, but also relevant with all other state changes).
Please report this to the application authors.