Bug 420747

Summary: KQuickAddons.Plotter skips repaints
Product: [Frameworks and Libraries] frameworks-kdeclarative Reporter: Konstantinos Smanis <konstantinos.smanis>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: kdelibs-bugs-null, nate
Priority: NOR    
Version First Reported In: 5.69.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screencast (applet update interval: 1 second)

Description Konstantinos Smanis 2020-04-29 11:04:33 UTC
Created attachment 127986 [details]
Screencast (applet update interval: 1 second)

SUMMARY
The KQuickAddons.Plotter used for the System Monitor applets occasionally skips repaints, leading to jumpy plots.

More specifically, the skips occur because the plot itself will not be repainted unless another element in the QML scene changes. According to my understanding, Plotter::addSample() triggers Plotter::update(), which in turn triggers Plotter::updatePaintNode(). However, Plotter::updatePaintNode() only seems to be initializing the paint node, not actually rendering it (why?), therefore relying only on the QQuickWindow::beforeRendering signal to trigger Plotter::render(). As a result, even if you add new samples to the plot, they will be rendered only if another element in the QML scene requires to be repainted.

For example, in the CPU load monitoring applet, if the CPU load remains the same across multiple measurements, the applet will not be repainted until a different CPU load measurement comes up. This can be observed in the attached screencast twice:
 * the first time, the CPU load remains at 14% for two ticks, leading to one missed repaint
 * the second time, the CPU load remains at 14% for four ticks, leading to three missed repaints

STEPS TO REPRODUCE
1. Observe any system monitor applet (preferably in plasmoidviewer or on the desktop, because on a panel other applets will trigger a repaint)
2. Wait for multiple same measurements

OBSERVED RESULT
The applet is not repainted while the measurement remains the same. It is only updated when a different measurement comes up.

EXPECTED RESULT
The applet should be repainted for every measurement.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.1
Kernel Version: 5.6.7-gentoo
OS Type: 64-bit
Comment 1 Nate Graham 2021-03-17 21:38:52 UTC
This component is deprecated in favor of the fancy new hardware-accelerated charts provided by KQuickCharts, and the only things known to be using it have since been ported away. Not worth fixing, since it's a dead man walking. :)