Bug 400645 - First launch of Discover after boot: Borders drawn but content of window is "screenshot" of the last active window for 1-2 seconds
Summary: First launch of Discover after boot: Borders drawn but content of window is "...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.14.2
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 410197 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-04 06:22 UTC by DozyDolphin
Modified: 2019-07-26 14:06 UTC (History)
3 users (show)

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


Attachments
screenshot showing the bug (1.45 MB, image/png)
2019-07-12 15:07 UTC, S. Christian Collins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DozyDolphin 2018-11-04 06:22:16 UTC
SUMMARY

When first starting Discover after booting the computer, the content of the discover window is showing content of the last active window - e.g. if Firefox was open the Discover window will show the content of the firefox window within its borders. 

This happens for 1-2 seconds. Following launches of Discover doesn't have this problem. It does however have a short flash before the UI kicks in, which could indicate that the same problem is present, but elements have been loaded in some form already so it isn't as noticeable.

I have an Intel Iris 650 GPU

STEPS TO REPRODUCE
1. Boot your computer
2. Launch Firefox
3. Launch Discover

OBSERVED RESULT
See the summary above

EXPECTED RESULT
That content from other windows isn't showing in the Discover window.
Either the window shouldn't be drawn until all necessary ressources are available or the background of the window could be drawn and then populated when things have finished loading. Either way would look better. 

SOFTWARE VERSIONS
KDE Plasma Version: 5.14.2
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION

I will update with a screenshot and information about whether I have the same issue on another KDE NEON machine asap
Comment 1 DozyDolphin 2018-11-04 06:30:50 UTC
I experience the same problem on my Thinkpad 420s
Comment 2 Christoph Feck 2018-11-20 12:12:41 UTC
Wayland or X11? I suggest to also add the KWin support information.

qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation

I remember we had this issue (frames are rendered before the window content is ready) with previous versions, and toolkits had to explicitely support some syncronization protocols to prevent that from happening.

Not sure what the status with Qt5/QtQuick/Wayland is.
Comment 3 DozyDolphin 2018-11-21 05:48:58 UTC
Hi Cristoph,

I'm using X11.

KWin support information:

https://paste.kde.org/papaajmya
Comment 4 S. Christian Collins 2019-07-12 15:07:03 UTC
Created attachment 121482 [details]
screenshot showing the bug

Here is a screenshot of this bug happening on my laptop.

I've seen this happen with other slow-to-start applications as well (particularly Thunderbird), so perhaps this is a Kwin bug? I've noticed that other desktop environments will paint the area within the frame using the system color scheme's background color, whereas Plasma 5 displays a screenshot of what is underneath the window instead, at least on X11. I can see the reasoning behind this, but it doesn't always work out so well for a couple reasons:

1. Some applications (such as Discover) appear to grab the screenshot before the window is automatically repositioned, resulting in the window background looking quite off and buggy, as you can see in my screenshot. It looks even more ridiculous on my desktop when Discover opens on my second monitor showing content from my first monitor as its background.

2. I've had the following scenario happen more than once: I'm using an application and launch Thunderbird, which takes a while to load on my laptop with slow hard drive. The Thunderbird window decoration appears with a screen capture of the application I was just working on displayed as its contents. I don't notice the Thunderbird window decoration appear and continue trying to work in my application, which now appears frozen because I'm actually clicking on the screenshot-painted Thunderbird window unwittingly.

Is there any reason that Plasma doesn't just paint new windows with the window background color until that application provides its window contents? I think overall this would lead to less confusion and appearance of bugginess.

It is easy to reproduce this in virtualbox using Kubuntu or KDE neon. I haven't tried other distributions.
Comment 5 Martin Flöser 2019-07-13 12:27:24 UTC
This is a typical problem of graphics drivers on X11 for applications using opengl. There is nothing we can do except switching to Wayland.
Comment 6 Nate Graham 2019-07-26 14:06:10 UTC
*** Bug 410197 has been marked as a duplicate of this bug. ***