Bug 449975 - Desktop background can be seen while alt+tab-ing between maximized windows
Summary: Desktop background can be seen while alt+tab-ing between maximized windows
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-10 22:12 UTC by Albert Astals Cid
Modified: 2024-06-06 18:56 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2022-02-10 22:12:20 UTC
STEPS TO REPRODUCE
1. Have a few maximized apps open
2. Alt+tab between them

OBSERVED RESULT

Occasionally i see 1 or 2 frames of the desktop background, now that it's dark it's super distracting


EXPECTED RESULT

Just switch between the apps, don't show me the background

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Archlinux
KDE Plasma Version:  5.24.0 X11
KDE Frameworks Version:  5.90.0
Qt Version: 5.12.kde


Here a video recorded, in the video it's much harder to appreciate than in real life, i guess my camera is not very good and youtube potentially also  dropped some frames https://www.youtube.com/watch?v=j_HLc7XcD8w but if you see a screenshot i managed to capture of that video https://i.imgur.com/Kcj8QWn.png on the top right you can see that red/orange-ish part belonging to the background.
Comment 1 Albert Astals Cid 2022-02-10 22:16:21 UTC
Qt 5.15.kde obviously, sorry for the mental-slip
Comment 2 Vlad Zahorodnii 2022-02-11 08:27:04 UTC
Can you post the output of `qdbus org.kde.KWin /KWin supportInformation`? Can't reproduce it myself.
Comment 3 Albert Astals Cid 2022-02-11 08:49:37 UTC
On this computer i can reproduce it *VERY* easily https://ghostbin.com/RULuW/raw (alt-tabbing and alt+shift-tabbing between konsole and firefox will make it happen say 30% of the time).

On my other (faster/newer laptop https://ghostbin.com/EFiEo/raw ) I can see it sometimes, but much less often, maybe it's a driver/CPU speed issue? I'm going to try with a much slower one now.

Also make sure you use the Plasma 5.24 background, it being so distinctively black and red in places defenitely helps realizing "this should not be here"
Comment 4 Vlad Zahorodnii 2022-02-11 09:01:37 UTC
Does this happen with other task switchers, e.g. breeze? Does kwin also print any warnings in the logs?
Comment 5 Albert Astals Cid 2022-02-11 10:09:44 UTC
Yes, it also happens with the breeze switcher.

This is what i get from a "clean" kwin_x11 --replace
https://ghostbin.com/49Iw5/raw

I don't get "new" debug/warnings when the issue happens.
Comment 6 Albert Astals Cid 2022-02-11 10:12:50 UTC
As a baseline i disabled the compositor (Alt+Shift+F12) and this problem doesn't happen anymore
Comment 7 Nate Graham 2022-02-11 21:45:11 UTC
Cannot reproduce at all on Wayland.
Comment 8 Albert Astals Cid 2022-02-11 23:18:38 UTC
I'm not sure it's a regression, this may have been happening for a while, just the new wallpaper is much more intense so seeing it is much more distracting.

On Matrix we tracked it to the "highlight window" effect

Vlad said

 if you switch from window A to B, the highlight window effect (enabled by "show selected window" in system settings) will start two animations
A: opacity goes from 1 to 0
B: opacity goes from 0 to 1
so desktop background can sneak through

And suggested that maybe the highlight window effect could start 0 -> 1 animation first and delay 1 -> 0 animation

I'll try to see if i can make that happen and test it myself, though the code in https://invent.kde.org/plasma/kwin/-/blob/master/src/effects/highlightwindow/highlightwindow.cpp is not as easy to understand as i'd like ^_^
Comment 9 Albert Astals Cid 2022-02-14 12:49:22 UTC
After discussing on Matrix, parallel cross fading will always result in this, needs to be sequential, but I don't have enough understanding of the code to be able to work on that, so someone else needs to tackle this.

kbroulik: if you have two items ontop of each other with opacity < 1 you will always see through

ahiemstra: combining opacity is more like averaging their values rather than adding them up
generally, for cross fade animations what you want to do is have the original image at opacity 1 until the end and fade the new image from 0 to 1 on top of that