Bug 438458

Summary: Yakuake flashes solid color when closing it in Plasma 5.22 in X11
Product: [Plasma] kwin Reporter: p d <pizzadude>
Component: scene-openglAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: daniel-other+kdebug, elman, freggel.doe, harveydevel, i, kokoko3k, nate, sephiroth_pk, swastiksayan2712, s_chriscollins, yule2000
Priority: NOR Keywords: regression
Version: 5.21.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=435378
Latest Commit: Version Fixed In: 5.22.5
Sentry Crash Report:

Description p d 2021-06-11 10:52:30 UTC
SUMMARY

Yakuake flashes blue when closing it in Plasma 5.22 in X11. This doesn't happen in Wayland. Unchecking "Ask the window manager to perform the animation" in "Configure Yakuake" works around the issue. 

I have recorded a short video of the issue so you know what I'm talking about: https://www.youtube.com/watch?v=D3ykqKQrY1o

STEPS TO REPRODUCE
1. Be on Plasma 5.22 X11 session
2. Make sure "Ask the window manager to perform the animation" is checked in "Configure Yakuake"
3. Close Yakuake

OBSERVED RESULT
Blue flash / flicker

EXPECTED RESULT
No seizure inducing blue flash


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Operating System: Fedora 34
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.9-300.fc34.x86_64 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-7300U CPU @ 2.60GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620


ADDITIONAL INFORMATION
I use the "zawertun/kde" copr repo for latest plasma.
Comment 1 elman 2021-06-11 15:00:22 UTC
Same here. It started with 5.22. I'm on Manjaro unstable.
Comment 2 Riccardo Robecchi 2021-06-11 16:12:02 UTC
I can confirm the bug.
Comment 3 Timothy B 2021-06-17 15:41:35 UTC
I can confirm this since I upgraded Plasma to 5.22, but I get a solid black color because I use a different theme. This behavior also occurs when I uncheck "Ask the window manager to perform the animation" and set the duration slider to all the way to the left (0 ms).
Comment 4 sayan 2021-07-14 03:04:07 UTC
Confirming the bug with another workaround: Disable sliding popups from Desktop effects.
System: Manjaro 21.1 
DE: KDE 5.84.0 / Plasma 5.22.3
Comment 5 Timothy B 2021-07-14 03:22:47 UTC
In reply to comment #4:

> Disable sliding popups from Desktop effects

I can confirm that workaround too, but the behavior persists when the duration slider in Yakuake's window settings page is set all the way to the left (or 0ms).
Comment 6 freggel.doe 2021-07-14 06:05:09 UTC
Unticking the "Ask the window manager to perform the animation" also seems to work around this issue.
Comment 7 Timothy B 2021-07-22 01:13:19 UTC
I stumbled upon bug #435378, which I believe looks very similar to this ticket, but it pinpointed when the issue began in the Git version of Plasma 5.22. At least I can confirm that this behavior started to appear with that particular Plasma version.

I'm no maintainer, but I think it's safe to say that this bug report is a possible duplicate of the aformentioned bug, but that has yet to be verified by the developers as to if this bug was caused by either Yakuake, KWin, or Konsole.
Comment 8 Antonio Orefice 2021-08-03 16:17:34 UTC
Works fine till kwin 5.21.90
Downgrading it makes it work (have to downgrade kwayland-server to the same version too to make it happy)
Comment 9 Antonio Orefice 2021-08-04 10:43:12 UTC
Bisected. The offending commit is:

koko@Gozer# git bisect good
47113e09b8a80497463725a795728a34e9db940c is the first bad commit
commit 47113e09b8a80497463725a795728a34e9db940c
Author: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date:   Thu Feb 4 11:07:20 2021 +0200

    scene: Introduce window items
    
    Currently, dealing with sub-surfaces is very difficult due to the scene
    design being heavily influenced by X11 requirements.
    
    The goal of this change is to re-work scene abstractions to make improving
    the wayland support easier.
    
    The Item class is based on the QQuickItem class. My hope is that one day
    we will be able to transition to QtQuick for painting scene, but in
    meanwhile it makes more sense to have a minimalistic internal item class.
    
    The WindowItem class represents a window. The SurfaceItem class represents
    the contents of either an X11, or a Wayland, or an internal surface. The
    DecorationItem and the ShadowItem class represent the server-side deco and
    drop-shadow, respectively.
    
    At the moment, the SurfaceItem is bound to the scene window, but the long
    term plan is to break that connection so we could re-use the SurfaceItem
    for things such as software cursors and drag-and-drop additional icons.
    
    One of the responsibilities of the Item is to schedule repaints as needed.
    Ideally, there shouldn't be any addRepaint() calls in the core code. The
    Item class schedules repaints on geometry updates. In the future, it also
    has to request an update if its opacity or visibility changes.

 src/CMakeLists.txt                             |   8 +
 src/abstract_client.cpp                        |   8 +-
 src/abstract_client.h                          |   5 +-
 src/composite.cpp                              |  20 +-
 src/decorationitem.cpp                         |  35 ++
 src/decorationitem.h                           |  36 ++
 src/effects.cpp                                |   3 +-
 src/events.cpp                                 |   4 -
 src/internal_client.cpp                        |   5 +-
 src/item.cpp                                   | 345 ++++++++++++++++++++
 src/item.h                                     | 142 ++++++++
 src/plugins/scenes/opengl/scene_opengl.cpp     | 280 ++++++++--------
 src/plugins/scenes/opengl/scene_opengl.h       |   6 +-
 src/plugins/scenes/qpainter/scene_qpainter.cpp |  46 ++-
 src/plugins/scenes/qpainter/scene_qpainter.h   |   5 +-
 src/plugins/scenes/xrender/scene_xrender.cpp   |  26 +-
 src/scene.cpp                                  | 433 ++++++++-----------------
 src/scene.h                                    | 181 ++---------
 src/shadowitem.cpp                             |  46 +++
 src/shadowitem.h                               |  35 ++
 src/surfaceitem.cpp                            | 119 +++++++
 src/surfaceitem.h                              |  55 ++++
 src/surfaceitem_internal.cpp                   |  46 +++
 src/surfaceitem_internal.h                     |  34 ++
 src/surfaceitem_wayland.cpp                    | 151 +++++++++
 src/surfaceitem_wayland.h                      |  61 ++++
 src/surfaceitem_x11.cpp                        | 141 ++++++++
 src/surfaceitem_x11.h                          |  47 +++
 src/toplevel.cpp                               | 251 ++++----------
 src/toplevel.h                                 |  42 +--
 src/unmanaged.cpp                              |  53 +--
 src/unmanaged.h                                |   4 +-
 src/windowitem.cpp                             | 143 ++++++++
 src/windowitem.h                               |  90 +++++
 src/x11client.cpp                              |  31 +-
 src/x11client.h                                |   3 +-
 src/xwaylandclient.cpp                         |  19 +-
 37 files changed, 2015 insertions(+), 944 deletions(-)
 create mode 100644 src/decorationitem.cpp
 create mode 100644 src/decorationitem.h
 create mode 100644 src/item.cpp
 create mode 100644 src/item.h
 create mode 100644 src/shadowitem.cpp
 create mode 100644 src/shadowitem.h
 create mode 100644 src/surfaceitem.cpp
 create mode 100644 src/surfaceitem.h
 create mode 100644 src/surfaceitem_internal.cpp
 create mode 100644 src/surfaceitem_internal.h
 create mode 100644 src/surfaceitem_wayland.cpp
 create mode 100644 src/surfaceitem_wayland.h
 create mode 100644 src/surfaceitem_x11.cpp
 create mode 100644 src/surfaceitem_x11.h
 create mode 100644 src/windowitem.cpp
 create mode 100644 src/windowitem.h
Comment 10 Bug Janitor Service 2021-08-04 17:37:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1223
Comment 11 Vlad Zahorodnii 2021-08-05 06:03:33 UTC
Git commit e94fbcd853fe4101c9d82b4df0803c7b6e97c0d4 by Vlad Zahorodnii.
Committed on 05/08/2021 at 06:03.
Pushed by vladz into branch 'master'.

Copy shape region to Deleted

Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.

If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.
Related: bug 440001, bug 435378

M  +2    -0    src/toplevel.cpp

https://invent.kde.org/plasma/kwin/commit/e94fbcd853fe4101c9d82b4df0803c7b6e97c0d4
Comment 12 Vlad Zahorodnii 2021-08-05 06:03:54 UTC
Git commit ad62f7c3b7ba60182ae42d1573dae8fd57560ad7 by Vlad Zahorodnii.
Committed on 05/08/2021 at 06:03.
Pushed by vladz into branch 'Plasma/5.22'.

Copy shape region to Deleted

Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.

If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.
Related: bug 440001, bug 435378


(cherry picked from commit e94fbcd853fe4101c9d82b4df0803c7b6e97c0d4)

M  +2    -0    src/toplevel.cpp

https://invent.kde.org/plasma/kwin/commit/ad62f7c3b7ba60182ae42d1573dae8fd57560ad7