Bug 451151 - Hovering windows in the Present Windows effects creates a gap between the window title and window content
Summary: Hovering windows in the Present Windows effects creates a gap between the win...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-present-windows (show other bugs)
Version: 5.24.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-05 02:12 UTC by Adam Fontenot
Modified: 2022-05-05 15:11 UTC (History)
2 users (show)

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


Attachments
screenshot of the problem (133.76 KB, image/png)
2022-03-05 02:12 UTC, Adam Fontenot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Fontenot 2022-03-05 02:12:18 UTC
Created attachment 147287 [details]
screenshot of the problem

SUMMARY
When I hover over a window in the Present Windows effect, the window expands in size in response to the cursor. However, when this happens, a flickering gap between the window title (part of the decoration drawn by KWin) and the window content (draw by the application) sometimes appears.

STEPS TO REPRODUCE
1. Open Present Windows (e.g. by clicking on an Icons-Only Task Manager icon)
2. Hover over a window.

OBSERVED RESULT
When the window is rescaled, for some windows a gap will appear between the window title and the window content and never disappear. For others, it will appear at some point during the scaling transition effect on the window, but then disappear before the window reaches its final scaled state. For others, the gap never appears at all.

EXPECTED RESULT
The window always behaves as a single object, with no break between the title and content.

SOFTWARE/OS VERSIONS
Linux: Arch Linux kernel 5.16.11 x86_64
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

My guess is that the problem has a similar cause as https://bugs.kde.org/show_bug.cgi?id=412573 Trying to separately scale two objects that are adjacent is a common source of graphics bugs like this.

I've added a screenshot of the problem. It is also visible in a screencast I made to illustrate a different bug: https://0x0.st/oP_g.mp4
Mirror / backup link: https://ipfs.io/ipfs/QmcXt2g9QQ1mioUeB2sLHvb8G9mh3ApRmVPacoBjAjhJCp
Comment 1 Niklas Stephanblome 2022-04-05 16:52:03 UTC
Can't reproduce, what do you mean by "a gap appears"?
Comment 2 Adam Fontenot 2022-04-06 00:17:11 UTC
(In reply to Niklas Stephanblome from comment #1)
> Can't reproduce, what do you mean by "a gap appears"?

This is almost certainly some kind of graphics / openGL bug, so it's not too surprising if not everyone can reproduce it.

Can you see my screenshot of the problem attached to the issue? When in Present Windows, if I hover over a window it changes the size of the window. The is just a static bitmap preview of the window contents, and it looks like the window titlebar and the window are rendered as separate bitmaps. Resizing them at the same time creates aliasing artifacts between them, creating a gap between them through which you can kind of see colors from the background flickering through.

In my screenshot, this is happening on the top left, just under the window title bar.
Comment 3 Adam Fontenot 2022-04-12 00:07:14 UTC
I tested and was able to reproduce this on different hardware with a separate KDE installation. It's not consistent, even on my hardware. The bug seems to appear when a resize operation occurs on the window preview bitmap of a particular size. Certain amounts of resizing cause the gap to appear, others do not.

In the following screenshot, you can clearly see that it *is* a gap that appears, not just a line. You can see hints of the background image (one of the default KDE wallpapers) behind the window: https://i.imgur.com/yrZ3CXY.png
Comment 4 Nate Graham 2022-05-05 15:11:26 UTC
This has been fixed with the rewrite in Plasma 5.25, done by Marco Martin with https://invent.kde.org/plasma/kwin/-/commit/376ee357dbc50fec3b6e71c40938171ddb2e726a!