Bug 477855 - Plasmashell consumes CPU time doing nothing until System Tray popup is opened once
Summary: Plasmashell consumes CPU time doing nothing until System Tray popup is opened...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray widget (other bugs)
Version First Reported In: 5.27.9
Platform: Other Linux
: NOR major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency-and-performance
Depends on:
Blocks:
 
Reported: 2023-12-01 17:51 UTC by Stefan Brüns
Modified: 2025-09-28 20:38 UTC (History)
7 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 Stefan Brüns 2023-12-01 17:51:16 UTC
SUMMARY

After plasmashell has started, it is consuming CPU time doing apparently nothing.

According to strace, it is woken up due to a ~16ms ppoll timeout. This is likely some animation which has not been stopped correctly.

The polling stops as soon as the "Status and Notification" popup is opened the first time, afterwards the process is completely idle.

STEPS TO REPRODUCE
1. Start plasmashell (as part of the session, or with --restart, does not matter)
2. Attach strace to the main thread
3. Open the popup using the ^ up arrow

OBSERVED RESULT
Plasmashell consumes CPU time doing nothing, and behaves correctly after opening the popup once.

EXPECTED RESULT
Plasmashell becomes idle immediately after start, without user intervention.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-12-08 17:49:25 UTC
Are you able to reproduce this by simply restarting plasmashell? Or does it only happen when plasmashell stars following a login event?

Can you provide a screenshot of that your System Tray looks like so I can see what's in it?
Comment 2 Stefan Brüns 2023-12-08 18:00:27 UTC
I have seen this also after "plasmashell --replace", so probably unrelated to session start (though, there may be some timing related stuff which has an influence).

One influenced system was a fresh installation, i.e. very basic.
Comment 3 Bug Janitor Service 2023-12-23 03:46:25 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Nate Graham 2025-08-28 21:11:05 UTC
It's been a while, and there haven't been any new reports of this. I still have never seen it myself. Stefan, can you still reproduce this in a new clean user account in Plasma 6.4 or later? Thanks!
Comment 5 Bug Janitor Service 2025-09-12 03:48:13 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2025-09-27 03:46:34 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 8 Martin 2025-09-27 12:12:48 UTC
I have not tested on a clean user account, but both me and a person in this thread can reproduce it - https://www.reddit.com/r/kde/comments/1nrbg96/comment/nggt9ej/?context=1

I get plasmashell handling 165 events/s, and the other person 60/s, matching screen refresh rate.

Issue seems as easy to reproduce as closing down all unneeded programs, calling systemctl --user restart plasma-plasmashell and watching events fire off in powertop.

Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.8-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 32 GiB of RAM (27.3 GiB usable)
Graphics Processor 1: NVIDIA GeForce RTX 3060 Laptop GPU
Graphics Processor 2: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 82JQ
System Version: Legion 5 Pro 16ACH6H
Comment 9 Bo Zhang 2025-09-27 12:31:44 UTC
So this has been an issue since 5.27 and is still happening in 6.4.5. Any devs available to reproduce this issue? I might have to look at the code myself but I'm not familiar with who Plasma is coded.
Comment 10 Fabian Vogt 2025-09-27 16:11:18 UTC
Using QML_ANIMATION_TICK_DUMP=true plasmashell --replace, I can see:

***** Dumping Animation Tree ***** ( tick: 1053 delta: 13 )
QuickAnimatorProxyJob( 0x562682d558f0 state: 2 duration: -1 proxying: ( QSharedPointer(QuickAnimatorJob(0x562682d2b470) state:0duration:100target:ButtonShadow_QMLTYPE_48(0x562682d02db0, parent=0x562682e7e700, geometry=-3,-3 88x88)value:0) )
QuickAnimatorProxyJob( 0x562682d55ad0 state: 2 duration: -1 proxying: ( QSharedPointer(QuickAnimatorJob(0x562682e858f0) state:0duration:100target:ButtonShadow_QMLTYPE_48(0x562682cf59e0, parent=0x562682e79830, geometry=-3,-3 88x88)value:0) )
QuickAnimatorProxyJob( 0x562682da59b0 state: 2 duration: -1 proxying: ( QSharedPointer(QuickAnimatorJob(0x562682da5c50) state:0duration:100target:ButtonShadow_QMLTYPE_48(0x562682d35680, parent=0x562682c90690, geometry=-3,-3 88x88)value:0) )
QuickAnimatorProxyJob( 0x562682e9e400 state: 2 duration: -1 proxying: ( QSharedPointer(QuickAnimatorJob(0x562682e9e540) state:0duration:100target:ButtonShadow_QMLTYPE_48(0x562682c31960, parent=0x562682da8bb0, geometry=-3,-3 88x88)value:0) )
QuickAnimatorProxyJob( 0x562682ebeb10 state: 2 duration: -1 proxying: ( QSharedPointer(QuickAnimatorJob(0x562682ebec50) state:0duration:100target:ButtonShadow_QMLTYPE_48(0x562682d82c20, parent=0x562682d38230, geometry=-3,-3 88x88)value:0) )

FWICT those are the OpacityAnimators of libplasma ButtonShadow instances, but disabled (state: 0). The QuickAnimatorProxyJob for them is running though. Qt bug?
Comment 11 Fabian Vogt 2025-09-27 16:19:20 UTC
(In reply to Fabian Vogt from comment #10)
> FWICT those are the OpacityAnimators of libplasma ButtonShadow instances,
> but disabled (state: 0). The QuickAnimatorProxyJob for them is running
> though. Qt bug?

Maybe? With this diff applied to libplasma, the running QuickAnimatorProxyJobs are gone and strace shows that plasmashell is idling properly:

diff --git a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
index e853972ec..757dce36f 100644
--- a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
+++ b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
@@ -28,6 +28,6 @@ KSvg.FrameSvgItem {
     opacity: showShadow ? 1 : 0
     Behavior on opacity {
         enabled: Kirigami.Units.shortDuration > 0
-        OpacityAnimator { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutQuad }
+        NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutQuad }
     }
 }
Comment 12 Bo Zhang 2025-09-28 09:05:59 UTC
If I set the Plasma desktop animation speed to instant, it solves the issue. So definitely a Qt animation stuck in some error mode issue.
Comment 13 Bo Zhang 2025-09-28 11:08:04 UTC
(In reply to Fabian Vogt from comment #11)
> (In reply to Fabian Vogt from comment #10)
> > FWICT those are the OpacityAnimators of libplasma ButtonShadow instances,
> > but disabled (state: 0). The QuickAnimatorProxyJob for them is running
> > though. Qt bug?
> 
> Maybe? With this diff applied to libplasma, the running
> QuickAnimatorProxyJobs are gone and strace shows that plasmashell is idling
> properly:
> 
> diff --git
> a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> index e853972ec..757dce36f 100644
> --- a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> +++ b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> @@ -28,6 +28,6 @@ KSvg.FrameSvgItem {
>      opacity: showShadow ? 1 : 0
>      Behavior on opacity {
>          enabled: Kirigami.Units.shortDuration > 0
> -        OpacityAnimator { duration: Kirigami.Units.shortDuration;
> easing.type: Easing.OutQuad }
> +        NumberAnimation { duration: Kirigami.Units.shortDuration;
> easing.type: Easing.OutQuad }
>      }
>  }

When making this change, do you have to rebuild Qt/Plasma libraries? I manually applied the code change in
/usr/lib64/qt6/qml/org/kde/plasma/components/private/ButtonShadow.qml
But the problem persists.
Comment 14 Fabian Vogt 2025-09-28 12:14:23 UTC
(In reply to Bo Zhang from comment #13)
> (In reply to Fabian Vogt from comment #11)
> > (In reply to Fabian Vogt from comment #10)
> > > FWICT those are the OpacityAnimators of libplasma ButtonShadow instances,
> > > but disabled (state: 0). The QuickAnimatorProxyJob for them is running
> > > though. Qt bug?
> > 
> > Maybe? With this diff applied to libplasma, the running
> > QuickAnimatorProxyJobs are gone and strace shows that plasmashell is idling
> > properly:
> > 
> > diff --git
> > a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> > b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> > index e853972ec..757dce36f 100644
> > --- a/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> > +++ b/src/declarativeimports/plasmacomponents3/private/ButtonShadow.qml
> > @@ -28,6 +28,6 @@ KSvg.FrameSvgItem {
> >      opacity: showShadow ? 1 : 0
> >      Behavior on opacity {
> >          enabled: Kirigami.Units.shortDuration > 0
> > -        OpacityAnimator { duration: Kirigami.Units.shortDuration;
> > easing.type: Easing.OutQuad }
> > +        NumberAnimation { duration: Kirigami.Units.shortDuration;
> > easing.type: Easing.OutQuad }
> >      }
> >  }
> 
> When making this change, do you have to rebuild Qt/Plasma libraries?

Unfortunately yes. For some reason, libplasma ships the .qml file both inside the .so as well as in the filesystem.

> I
> manually applied the code change in
> /usr/lib64/qt6/qml/org/kde/plasma/components/private/ButtonShadow.qml
> But the problem persists.