Bug 468903 - ProgressBar animation causes redraws even if invisible
Summary: ProgressBar animation causes redraws even if invisible
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: QStyle (show other bugs)
Version: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-24 13:14 UTC by Fabian Vogt
Modified: 2023-04-28 21:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2023-04-24 13:14:08 UTC
It was noticed that discover has high CPU use even when idle.

I narrowed this down to a Kirigami.LoadingPlaceholder and furtder to the QQC2 ProgressBar.

Breeze has its own animation engine for progress bars, which calls updateItem regularly even for invisible items.

Reproducer:

import QtQuick 2.15
import QtQuick.Controls 2.15

ProgressBar {
        id: p
        width: 100
        height: 100
        visible: true
        onVisibleChanged: console.log(this, visible)
        indeterminate: true

        Timer {
                interval: 1000
                repeat: false
                running: true
                onTriggered: parent.visible = false;
        }
}

Run with QT_LOGGING_RULES=*.debug=true to see the scheduled draws.

Originally reproduced downstream: http://bugzilla.opensuse.org/show_bug.cgi?id=1210747
Comment 1 ratijas 2023-04-26 09:16:20 UTC
Git commit b92169d587424fef59412aaf8ceb5e2318592c8d by ivan tkachenko.
Committed on 26/04/2023 at 09:06.
Pushed by ratijas into branch 'master'.

ProgressBar: Stop emitting polish requests when item becomes invisible

M  +17   -0    kstyle/animations/breezebusyindicatorengine.cpp

https://invent.kde.org/plasma/breeze/commit/b92169d587424fef59412aaf8ceb5e2318592c8d
Comment 2 ratijas 2023-04-26 10:17:42 UTC
Git commit 47ba564392d42991931491740d02bb1aed8409b6 by ivan tkachenko.
Committed on 26/04/2023 at 09:38.
Pushed by ratijas into branch 'Plasma/5.27'.

ProgressBar: Stop emitting polish requests when item becomes invisible

(cherry picked from commit b92169d587424fef59412aaf8ceb5e2318592c8d)

M  +17   -0    kstyle/animations/breezebusyindicatorengine.cpp

https://invent.kde.org/plasma/breeze/commit/47ba564392d42991931491740d02bb1aed8409b6