Bug 439408 - Dirty shadows around certain panes, bars & application menus
Summary: Dirty shadows around certain panes, bars & application menus
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: libplasma (show other bugs)
Version: 5.84.0
Platform: openSUSE Linux
: VHI normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords: regression, wayland
: 429057 431761 438696 438723 439974 444533 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-07-02 13:44 UTC by Ad
Modified: 2022-01-12 07:18 UTC (History)
20 users (show)

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


Attachments
screenshots (830.39 KB, application/zip)
2021-07-02 13:44 UTC, Ad
Details
colored shadows theme (1.15 MB, application/x-bzip)
2021-09-01 22:41 UTC, Andrey
Details
Colored shadows, normal behaviour (13.69 KB, image/png)
2021-09-01 22:47 UTC, Andrey
Details
Broken shadows with colored theme (963.46 KB, image/png)
2021-09-02 12:14 UTC, Andrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ad 2021-07-02 13:44:39 UTC
Created attachment 139805 [details]
screenshots

SUMMARY
Most default widgets (default bottom bar + menu) render with dirty, empty-boxed "shadows", giving Plasma a sketchy look.

STEPS TO REPRODUCE
1. Create a new user and open a Plasma Wayland session from it.

OBSERVED RESULT
See the attached files. The first is from my current session. The second is from a new user's session.

EXPECTED RESULT
Clean shadows or no shadow, not the blurry, sketchy middle-ground shown here.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210629
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.12.13-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.5 Gio of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 530
Comment 1 Bacteria 2021-07-02 18:03:11 UTC
Can reproduce this one. Changing Plasma theme seems to fix it temporarily but the artifacts come back. Not sure what exactly triggers it.
Comment 2 David Edmundson 2021-07-02 22:15:43 UTC
X or wayland?
Comment 3 Bacteria 2021-07-03 03:59:54 UTC
Wayland for me.

KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Comment 4 Gui Do 2021-07-05 14:27:22 UTC
For me too on wayland
Comment 5 Alois Wohlschlager 2021-07-06 09:08:06 UTC
The shadows seem to be mirrored. I sometimes observe the same behavior as well. It does not happen all the time, but it seems to be consistent within one session.
Comment 6 David Edmundson 2021-07-06 09:37:29 UTC
Can you confirm if this is "resolved" by removing ~/.cache/*.kcache and restarting plasmashell
Comment 7 Patrick Silva 2021-07-06 12:59:34 UTC
possibly duplicate of bug 429057
Comment 8 Alois Wohlschlager 2021-07-06 13:30:54 UTC
> possibly duplicate of bug 429057

Might be related, but the glitch there looks pretty different to me. Bug 438696 is probably a duplicate of the present issue instead.
Comment 9 Alois Wohlschlager 2021-07-06 16:09:07 UTC
> Can you confirm if this is "resolved" by removing ~/.cache/*.kcache and restarting plasmashell

In fact, just restarting plasmashell seemed to be enough.
Comment 10 Ad 2021-07-06 21:35:29 UTC
Good catch David Edmundson, removing ~/.cache/*.kcache and restarting
plasmashell fixed it for me.

Le mar. 6 juil. 2021 à 18:09, Alois Wohlschlager
<bugzilla_noreply@kde.org> a écrit :
>
> https://bugs.kde.org/show_bug.cgi?id=439408
>
> --- Comment #9 from Alois Wohlschlager <alois1@gmx-topmail.de> ---
> > Can you confirm if this is "resolved" by removing ~/.cache/*.kcache and restarting plasmashell
>
> In fact, just restarting plasmashell seemed to be enough.
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 11 Ad 2021-07-07 08:21:53 UTC
(In reply to Ad from comment #10)
> Good catch David Edmundson, removing ~/.cache/*.kcache and restarting
> plasmashell fixed it for me.
> 
> Le mar. 6 juil. 2021 à 18:09, Alois Wohlschlager
> <bugzilla_noreply@kde.org> a écrit :
> >
> > https://bugs.kde.org/show_bug.cgi?id=439408
> >
> > --- Comment #9 from Alois Wohlschlager <alois1@gmx-topmail.de> ---
> > > Can you confirm if this is "resolved" by removing ~/.cache/*.kcache and restarting plasmashell
> >
> > In fact, just restarting plasmashell seemed to be enough.
> >
> > --
> > You are receiving this mail because:
> > You reported the bug.

In fact the problem happens again on every new fresh sessions even after removing the cache. I would not even consider it a temporary fix.
Comment 12 Alois Wohlschlager 2021-07-08 13:14:02 UTC
I think I have a reliable reproducer now (I use a left panel with Kickoff at the top and Digital Clock at the bottom, to put the locations of the mirrored shadows into context).

* When the first thing I do with a fresh plasmashell (i.e. after login or plasmashell restart) is opening Kickoff, subsequent popups will have mirrored shadows at the bottom and right sides. Kickoff itself only gets the mirrored shadow after another popup has appeared in the meantime.
* If the first thing I do is opening the calendar, subsequent popus will have mirrored shadows at the top and right sides. Similar to above, the calendar itself only displays mirrored shadows if something else was popped up in the meantime.
* If any popup other than the two mentioned before opens first (including the tooltip of Kickoff or Digital Clock), all shadows display in the correct orientation.
* Panel and window shadows are unaffected in any case.

The behavior is completely reproducible in my setup. Deleting the cache files does not seem to have any impact in any way.
Comment 13 Patrick Silva 2021-07-18 17:50:23 UTC
*** Bug 439974 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2021-08-04 19:54:40 UTC
Raising to VHI since this gives the impression that the desktop is completely unstable and broken.
Comment 15 Nate Graham 2021-08-06 14:09:19 UTC
Possibly relevant: whenever I open an applet popup on Wayland, I see the following printed to the console:

kf.plasma.quick: Couldn't create KWindowShadow for PlasmaQuick::Dialog_QML_230(0x32bdf60, name="popupWindow")
Comment 16 David Edmundson 2021-08-06 14:40:36 UTC
I don't think that's too relevant.



If someone can reproduce, can they send me their ~/.cache/plasma*
Comment 17 Nate Graham 2021-08-06 17:08:48 UTC
Sent offline since the file was too big to attach to the bug report.
Comment 18 David Edmundson 2021-08-06 22:38:22 UTC

*** This bug has been marked as a duplicate of bug 438644 ***
Comment 19 Nate Graham 2021-08-09 15:53:11 UTC
Not the same as Bug 438644; that bug report is about the white/gray artifacts in the corners caused by the background contrast effect not being able to round its mask properly (IIRC); this is about a cache invalidation bug whereby the wrong shadow SVGs are sometimes used.
Comment 20 Nate Graham 2021-08-09 15:53:39 UTC
*** Bug 439974 has been marked as a duplicate of this bug. ***
Comment 21 David Edmundson 2021-08-15 19:55:46 UTC
*** Bug 438644 has been marked as a duplicate of this bug. ***
Comment 22 Andrey 2021-08-17 17:48:30 UTC
Was able to reproduce twice a day.
It cleans up itself and happens again with no visible reason..
Comment 23 Andrey 2021-08-25 14:42:33 UTC
It happens randomly and disappears again.
I tried to reproduce it by taking the cache while it happens and restoring it after logout, no luck.
Comment 24 Nate Graham 2021-08-25 15:00:05 UTC
I can reproduce it somewhat reliably like this:

1. Be in an X11 session
2. Reboot
3. Log into a Wayland session
4. Change scale factor from 200% to to 175% and then back to 200% (working around Bug 433460)
5. Reboot

Then the shadows will be broken until I restart plasmashell
Comment 25 David Edmundson 2021-08-26 12:23:11 UTC
Nothing is particularly obvious, so I propose the following action plan:
 
 -  we make a qmlscene that shows shadow elements at their natural size
 -  we make a plasma theme that has blocky base colours (red, green, blue) for the different dialog-background-shadow-top/left/right elements
 - we find the numerical cache IDs for each element so we can retrieve them from a cache relatively easily
Comment 26 David Edmundson 2021-08-26 12:34:00 UTC
Documenting things we know:

This affects Dialog shadows mostly so:
 - the bug is not in FrameSVG
 - the bug is not in SVGItem
 - Within p-f only SVG directly

- But no other SVG is affected? So that implies it's not SVG, or there's something special about this

 - It affects both X and wayland
This /implies/ it's not at a KWindowSystem level, but we can't yet completely rule it out


 - When the client goes wrong it remains wrong until a client restart
This /implies/ it's not kwin as a new window vs a new client should be mostly the same
Comment 27 David Edmundson 2021-08-26 12:59:45 UTC
Ids

"shadow-top" : "1449101648"
"shadow-topright" : "1336515456"
"shadow-right" : "3033709554"
"shadow-bottomright" : "3158977252"
"shadow-bottom" : "2093078684"
"shadow-bottomleft" : "578256148"
"shadow-left" : "2934766096"
"shadow-topleft" : "2066772017"
Comment 28 Nate Graham 2021-08-26 13:56:58 UTC
Yeah, the net effect is that the bottom and right edges use the wrong shadow images.
Comment 29 Andrey 2021-08-27 09:30:23 UTC
(In reply to David Edmundson from comment #26)
>  - When the client goes wrong it remains wrong until a client restart

I'm not sure about this. I recall once the issue cleaned up itself while I was in the same session. As I see it right now I'll look when it restores.
Comment 30 Nate Graham 2021-09-01 14:11:07 UTC
*** Bug 429057 has been marked as a duplicate of this bug. ***
Comment 31 Nate Graham 2021-09-01 14:11:24 UTC
*** Bug 431761 has been marked as a duplicate of this bug. ***
Comment 32 Nate Graham 2021-09-01 14:11:31 UTC
*** Bug 438696 has been marked as a duplicate of this bug. ***
Comment 33 Nate Graham 2021-09-01 14:11:40 UTC
*** Bug 438723 has been marked as a duplicate of this bug. ***
Comment 34 Andrey 2021-09-01 22:41:53 UTC
Created attachment 141233 [details]
colored shadows theme

I've created a theme with colored shadow's elements.
Thus the bug should be clearly noticeable even on dark background - assuming there should be elements with the same color.
Comment 35 Andrey 2021-09-01 22:47:16 UTC
Created attachment 141234 [details]
Colored shadows, normal behaviour

I'll add new theme screenshot with the problem when I face it next time (will try also Nate's approach reproducing it).
Comment 36 David Edmundson 2021-09-02 10:22:03 UTC
For others installing it that attachment will extract to ./local/share/plasma/desktopthemes from within your CWD
Comment 37 Andrey 2021-09-02 11:56:34 UTC
(In reply to Alois Wohlschlager from comment #12)
> I think I have a reliable reproducer now (I use a left panel with Kickoff at
> the top and Digital Clock at the bottom, to put the locations of the
> mirrored shadows into context).
> 
> * When the first thing I do with a fresh plasmashell (i.e. after login or
> plasmashell restart) is opening Kickoff, subsequent popups will have
> mirrored shadows at the bottom and right sides. Kickoff itself only gets the
> mirrored shadow after another popup has appeared in the meantime.

Oh, thank you - was able to reproduce with it too!
Comment 38 Andrey 2021-09-02 12:14:07 UTC
Created attachment 141243 [details]
Broken shadows with colored theme

It was reproduced with https://bugs.kde.org/show_bug.cgi?id=439408#c12
Comment 39 Nate Graham 2021-09-02 14:44:42 UTC
(In reply to Andrey from comment #37)
> (In reply to Alois Wohlschlager from comment #12)
> > I think I have a reliable reproducer now (I use a left panel with Kickoff at
> > the top and Digital Clock at the bottom, to put the locations of the
> > mirrored shadows into context).
> > 
> > * When the first thing I do with a fresh plasmashell (i.e. after login or
> > plasmashell restart) is opening Kickoff, subsequent popups will have
> > mirrored shadows at the bottom and right sides. Kickoff itself only gets the
> > mirrored shadow after another popup has appeared in the meantime.
> 
> Oh, thank you - was able to reproduce with it too!

I can also reproduce with those steps and that setup. It didn't occur to me that my vertical panel might be a part of it.
Comment 40 Bug Janitor Service 2021-09-06 14:46:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwayland-integration/-/merge_requests/12
Comment 41 Andrey 2021-09-10 11:15:01 UTC
Git commit 11769ddffe25ca808228f7733aea5697ea41264d by Andrey Butirsky.
Committed on 08/09/2021 at 09:21.
Pushed by davidedmundson into branch 'master'.

fix a dirty shadows

ShmPool tries to resize itself when creating new images if the existing
allocated memory is too small.

As shadows currently use a single shared pool, this potentially happens
multiple times.

When an SHMPool is resized, the existing memory allocation is invalid
and all existing buffers have to be re-uploaded.  This patch introduces
one pool per tile, which alleviates that problem.

M  +4    -8    src/windowsystem/waylandintegration.cpp
M  +1    -2    src/windowsystem/waylandintegration.h
M  +6    -3    src/windowsystem/windowshadow.cpp
M  +4    -0    src/windowsystem/windowshadow.h

https://invent.kde.org/plasma/kwayland-integration/commit/11769ddffe25ca808228f7733aea5697ea41264d
Comment 42 Nate Graham 2021-10-28 14:42:09 UTC
*** Bug 444533 has been marked as a duplicate of this bug. ***