Bug 404641 - Lots of crud left in plasma.org.kde.plasma.desktopappletsrc left over from no-longer used desktop applets.
Summary: Lots of crud left in plasma.org.kde.plasma.desktopappletsrc left over from no...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: master
Platform: openSUSE Linux
: NOR minor
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-21 10:19 UTC by Rodney Baker
Modified: 2024-11-29 14:25 UTC (History)
11 users (show)

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


Attachments
plasma-org.kde.plasma.desktop-appletsrc showing the accumulated crud. (73.27 KB, text/plain)
2019-02-21 10:19 UTC, Rodney Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rodney Baker 2019-02-21 10:19:25 UTC
Created attachment 118249 [details]
plasma-org.kde.plasma.desktop-appletsrc showing the accumulated crud.

SUMMARY

When applets have been added and then removed (or failed to run) and re-added later, their configuration remains in ~/.config/plasma-org.kde.plasma.desktop-appletsrc. This file on my system is now >75k in length and contains entries from multiple desktop "containments" and long-gone instances of plasma applets. 

There appears to be no way to identify the currently running versions of applets and remove the old redundant configurations, apart from deleting and recreating the config from scratch (and thus losing all desktop customisations in the process). 

I don't know if it is directly related but the desktop currently takes around 30 seconds to appear after the splash screen goes away, leaving a black screen with only a mouse cursor present. I can start apps with Alt-F2 and they start correctly with all correct window decorations, but the desktop wallpaper, panels /menus and other applets take 30-45 seconds to appear.

STEPS TO REPRODUCE
1. Add desktop applets
2. Have those applets crash/fail to run after a version update or delete them from the desktop
3. Add new copies of the same applets.

OBSERVED RESULT
The old configuration entries remain in plasma-org.kde.plasma.desktop-appletsrc alongside the new entries.

EXPECTED RESULT

Old entries should be removed when the corresponding applets are removed. A tool to remove stale entries from the file should be provided. Only those entries related to currently loaded/running desktop containments and applets should remain.

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: openSUSE Tumbleweed
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.53.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
Comment 1 Bruno Friedmann 2019-02-22 18:36:47 UTC
+1 for a nice way of cleaning (maybe export a backup of only running actual session is easier?)

About you plasma black screen, it sometimes also happen here but I wasn't able to find a pattern to make it reproducible.
You can use the plasmashell --replace to restart your desktop (and at that time everything works).

My ~/.config/plasma-org.kde.plasma.desktop-appletsrc is 12k only.
Comment 2 Antonio Liccardo 2019-11-07 21:55:47 UTC
+1 from me too. Even if my ~/.config/plasma-org.kde.plasma.desktop-appletsrc is only 18K, it seems to me that there is a some slowdown in desktop loading, in contrast to a newly created user.
Comment 3 Antonio Liccardo 2019-11-07 21:56:09 UTC
+1 from me too. Even if my ~/.config/plasma-org.kde.plasma.desktop-appletsrc is only 18K, it seems to me that there is a some slowdown in desktop loading, in contrast to a newly created user.
Comment 4 Jack 2020-01-13 01:20:35 UTC
If nothing else, is the syntax of this file documented anywhere?  I have an apparently hidden panel which contains a appmenu widget which is giving me grief.  I'm willing to manually edit the file, but I'd rather not do so nearly blind.
Comment 5 Jack 2020-01-22 17:58:07 UTC
just for compulsiveness, should title change from plasma.org.... to plasma-org.....?  (change dot to dash)
Comment 6 Marco Martin 2024-11-29 13:59:41 UTC
Git commit f75b13d545c9c6d69c3ad357818adf2b0344a13d by Marco Martin.
Committed on 29/11/2024 at 13:59.
Pushed by mart into branch 'master'.

Systray: Clean up leaking systrays

Since removing a systray container didn't use to remove the
internal systray containment and all its applets, after a while
especially if default panels are added and removed often,
the applet config file becomes full of orphaned systray containments
that just take up resources and cause misbehaviors

This destroys on startup all org.kde.plasma.private.systray that are not
associated with a particular org.kde.plasma.systray

here went from an appletsrc config file of almost 7000 lines
to under 1000
Related: bug 472937

M  +47   -0    applets/systemtray/container/systemtraycontainer.cpp
M  +1    -0    applets/systemtray/container/systemtraycontainer.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/f75b13d545c9c6d69c3ad357818adf2b0344a13d
Comment 7 Marco Martin 2024-11-29 14:25:57 UTC
Git commit 7357e228ba88a6a16acc9f97628ce6fd4f40e2ab by Marco Martin.
Committed on 29/11/2024 at 14:24.
Pushed by mart into branch 'Plasma/6.2'.

systray: Clean up leaking systrays

backport of https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4944

Since removing a systray container didn't use to remove the
internal systray containment and all its applets, after a while
especially if default panels are added and removed often,
the applet config file becomes full of orphaned systray containments
that just take up resources and cause misbehaviors

This destroys on startup all org.kde.plasma.private.systray that are not
associated with a particular org.kde.plasma.systray
Related: bug 472937

M  +45   -0    applets/systemtray/container/systemtraycontainer.cpp
M  +1    -0    applets/systemtray/container/systemtraycontainer.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/7357e228ba88a6a16acc9f97628ce6fd4f40e2ab