Bug 416672

Summary: Window displays dirty buffer contents when shown before being completely drawn
Product: [Plasma] kwin Reporter: Gustavo <sancheztavo>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: minor CC: bugseforuns, ddgreen
Priority: NOR    
Version First Reported In: 5.16.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Opening Discover

Description Gustavo 2020-01-23 23:26:12 UTC
Created attachment 125354 [details]
Opening Discover

SUMMARY
If a window is set to visible before it's been drawn to it is displayed with contents from a dirty buffer (in my case I see a copy of of what's seen in the screen).

If this is only fixable by each application developer, then at least KDE apps  should not show the issue.

STEPS TO REPRODUCE
1. Start a program like Discover or LibreOffice

OBSERVED RESULT
A window frame is shown containing a static copy of what was in the screen before starting the application

EXPECTED RESULT
Window should only be visible when it's fully drawn, not with dirty contents. If this is not possible, at least it should show blank contents.

SOFTWARE/OS VERSIONS

Operating System: Kubuntu 19.10
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION

Kernel Version: 5.3.0-26-lowlatency
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-3770K CPU @ 3.50GHz
GPU Driver: NVIDIA Driver 430.50
Memory: 15.6 GiB of RAM
Comment 1 Patrick Silva 2020-02-09 22:45:12 UTC
rip Neil Peart :(

duplicate of bug 409262 ?
Comment 2 Gustavo 2020-02-09 23:16:44 UTC
Discover exhibits this behavior, yes (I will build latest discover to check if this behavior is fixed there), but I think kwin shouldn't let this happen, it would be much nicer if at least it blanked the window contents when a new one is created, since there are many apps that show this issue
Comment 3 Daniel Green 2021-02-28 20:27:42 UTC
I have had this happen for a while also, and no it wasn't fixed in 5.18 as 409262 suggested may have happened.

SOFTWARE/OS VERSIONS

Operating System: Arch linux
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

Kernel Version: 5.11.2-arch1-1 #1 SMP PREEMPT
OS Type: 64-bit
Processor: AMD Ryzen 3700x
GPU: NVIDIA GeForce GTX 660
GPU Driver: NVIDIA Driver 460.56
Memory: 32 GiB of RAM
Comment 4 Vlad Zahorodnii 2021-03-01 07:04:42 UTC
On X11, kwin uses sync counters to prevent cases like these. It seems like Discover updates the sync counter before actually rendering anything.
Comment 5 David Edmundson 2023-09-06 10:38:16 UTC
This bug was reported against an outdated version of KWin. We have made many changes since the. 
If the issue persists in newer versions can you reopen the bug report updating the version number.