From b1cc3e2fb00afe06e5ee40f94b0a13de33fb87a9 Mon Sep 17 00:00:00 2001
From: Bart Ribbers <bribbers@disroot.org>
Date: Fri, 9 Sep 2022 08:36:57 +0200
Subject: [PATCH] community/plasma-workspace: backport upstream requested patch

---
 ...nt-recurse-into-applets-containments.patch | 32 +++++++++++++++++++
 community/plasma-workspace/APKBUILD           |  7 ++--
 2 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 community/plasma-workspace/0001-widgetexplorer-Dont-recurse-into-applets-containments.patch

diff --git a/community/plasma-workspace/0001-widgetexplorer-Dont-recurse-into-applets-containments.patch b/community/plasma-workspace/0001-widgetexplorer-Dont-recurse-into-applets-containments.patch
new file mode 100644
index 000000000000..ff5a1e66317f
--- /dev/null
+++ b/community/plasma-workspace/0001-widgetexplorer-Dont-recurse-into-applets-containments.patch
@@ -0,0 +1,32 @@
+From c7ba560ccaac5e469cb2d6bf66c39e1acf967454 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <nicolas.fella@gmx.de>
+Date: Sun, 21 Aug 2022 16:33:50 +0200
+Subject: [PATCH] [widgetexplorer] Don't recurse into applet's containments
+
+The intention of this code appears to be finding system tray applets, since the systemtray is a containment within another applet/containment
+
+However the code causes an infinit recursion since we are calling addContainment on the same containment again
+
+The recursion also is unnecessary since corona->containments() already lists the system tray containment, so we don't need to find it by recursing through the panel's children
+---
+ components/shellprivate/widgetexplorer/widgetexplorer.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/components/shellprivate/widgetexplorer/widgetexplorer.cpp b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
+index c20bd59066..6de3890d5f 100644
+--- a/components/shellprivate/widgetexplorer/widgetexplorer.cpp
++++ b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
+@@ -280,10 +280,6 @@ void WidgetExplorerPrivate::addContainment(Containment *containment)
+ 
+     foreach (Applet *applet, containment->applets()) {
+         if (applet->pluginMetaData().isValid()) {
+-            Containment *childContainment = applet->property("containment").value<Containment *>();
+-            if (childContainment) {
+-                addContainment(childContainment);
+-            }
+             runningApplets[applet->pluginMetaData().pluginId()]++;
+         } else {
+             qDebug() << "Invalid plugin metadata. :(";
+-- 
+GitLab
+
diff --git a/community/plasma-workspace/APKBUILD b/community/plasma-workspace/APKBUILD
index 304f7294ad4e..22f0933f59e4 100644
--- a/community/plasma-workspace/APKBUILD
+++ b/community/plasma-workspace/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Bart Ribbers <bribbers@disroot.org>
 pkgname=plasma-workspace
 pkgver=5.25.5
-pkgrel=0
+pkgrel=1
 pkgdesc="KDE Plasma Workspace"
 # armhf blocked by kirigami2
 arch="all !armhf"
@@ -79,7 +79,9 @@ case "$pkgver" in
 	*.90*) _rel=unstable;;
 	*) _rel=stable;;
 esac
-source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-workspace-$pkgver.tar.xz"
+source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-workspace-$pkgver.tar.xz
+	0001-widgetexplorer-Dont-recurse-into-applets-containments.patch
+	"
 subpackages="$pkgname-dev $pkgname-libs $pkgname-doc $pkgname-lang $pkgname-dbg"
 replaces="plasma-desktop<5.24 breeze<5.22.90"
 
@@ -130,4 +132,5 @@ package() {
 
 sha512sums="
 0c6cf5104b584b34a8bcb45d57069fed3b25e871fccf1bfefd47d8fc1b595867c1c4f0fcfcc0e07847534e1e77ce8ed1f3be1ac6cb7eea8669a9c7649c8466cb  plasma-workspace-5.25.5.tar.xz
+e7e3866c3541f64fab3b8668ba32b046d13a4f17144fda932d3055922557f266c79f32c5cf36a851f50b21525a41ace73519e253c61a5f48d37ce6df0381bd0f  0001-widgetexplorer-Dont-recurse-into-applets-containments.patch
 "
-- 
GitLab