From bf02b7e9b24679d0e81ea65977bea4c5b94e749e4b58f8e2167d7973a593bf24 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Wed, 26 Apr 2023 20:04:41 +0000 Subject: [PATCH] Accepting request 1082880 from home:Vogtinator:plasma5.27 - Add patch to avoid CPU use in idle apps (boo#1210747, kde#468903): * 0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch OBS-URL: https://build.opensuse.org/request/show/1082880 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/breeze?expand=0&rev=409 --- ...-emitting-polish-requests-when-item-.patch | 53 +++++++++++++++++++ breeze.changes | 6 +++ breeze.spec | 2 + 3 files changed, 61 insertions(+) create mode 100644 0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch diff --git a/0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch b/0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch new file mode 100644 index 0000000..ec0b82f --- /dev/null +++ b/0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch @@ -0,0 +1,53 @@ +From 633a368833e824bf8b62d344057d079a1f533459 Mon Sep 17 00:00:00 2001 +From: ivan tkachenko +Date: Sun, 26 Feb 2023 00:17:53 +0300 +Subject: [PATCH] ProgressBar: Stop emitting polish requests when item becomes + invisible + +BUG: 468903 +--- + kstyle/animations/breezebusyindicatorengine.cpp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/kstyle/animations/breezebusyindicatorengine.cpp b/kstyle/animations/breezebusyindicatorengine.cpp +index 15d110e9..7fa8300b 100644 +--- a/kstyle/animations/breezebusyindicatorengine.cpp ++++ b/kstyle/animations/breezebusyindicatorengine.cpp +@@ -4,10 +4,16 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include "config-breeze.h" ++ + #include "breezebusyindicatorengine.h" + + #include "breezemetrics.h" + ++#if BREEZE_HAVE_QTQUICK ++#include ++#endif ++ + #include + + namespace Breeze +@@ -32,6 +38,17 @@ bool BusyIndicatorEngine::registerWidget(QObject *object) + + // connect destruction signal + connect(object, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); ++ ++#if BREEZE_HAVE_QTQUICK ++ if (QQuickItem *item = qobject_cast(object)) { ++ connect(item, &QQuickItem::visibleChanged, this, [=]() { ++ if (!item->isVisible()) { ++ this->setAnimated(object, false); ++ } ++ // no need for the else {} branch, as its animation will be reset anyway ++ }); ++ } ++#endif + } + + return true; +-- +2.40.0 + diff --git a/breeze.changes b/breeze.changes index 784b091..6777fb4 100644 --- a/breeze.changes +++ b/breeze.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 26 06:25:30 UTC 2023 - Fabian Vogt + +- Add patch to avoid CPU use in idle apps (boo#1210747, kde#468903): + * 0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch + ------------------------------------------------------------------- Tue Apr 4 15:05:32 UTC 2023 - Fabian Vogt diff --git a/breeze.spec b/breeze.spec index fdb34b0..23f9bc4 100644 --- a/breeze.spec +++ b/breeze.spec @@ -33,6 +33,8 @@ Source: https://download.kde.org/stable/plasma/%{version}/breeze-%{versi Source1: https://download.kde.org/stable/plasma/%{version}/breeze-%{version}.tar.xz.sig Source2: plasma.keyring %endif +# PATCH-FIX-UPSTREAM +Patch1: 0001-ProgressBar-Stop-emitting-polish-requests-when-item-.patch # PATCH-FEATURE-UPSTREAM Patch100: 0001-Outline-intensity-setting.patch # PATCH-FIX-OPENSUSE for ^