Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37042927
en ru br
ALT Linux repos
S:5.15.10-alt1

Group :: System/Libraries
RPM: qt5-declarative

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: alt-multiscreen-applet-sigsegv-fix.patch
Download


From 9dfefb85dd8a63c9f5332e0250806d8554d4d001 Mon Sep 17 00:00:00 2001
From: Slava Aseev <ptrnine@altlinux.org>
Date: Wed, 8 Dec 2021 17:42:24 +0300
Subject: [PATCH] Fix segfault after toggle the "Show Background" on applet
bug: https://bugs.kde.org/show_bug.cgi?id=443317
---
 src/quick/items/qquickitem.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/quick/items/qquickitem.cpp b/qtdeclarative/src/quick/items/qquickitem.cpp
index 67c4611d9e..9625819f83 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2696,8 +2696,16 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
                 QQuickWindowPrivate::get(d->window)->parentlessItems.remove(this);
             }
         }
-        if (parentWindow)
+        if (parentWindow) {
+            if (d->windowRefCount > 0 && d->window != parentWindow) {
+                qWarning() <<
+                    "WORKAROUND: an attempt to reference two different windows. The current implementation "
+                    "cannot handle this situation, so we will be forced to remove the previously referenced window.";
+                while (d->windowRefCount)
+                    d->derefWindow();
+            }
             d->refWindow(parentWindow);
+        }
     }
 
     d->dirty(QQuickItemPrivate::ParentChanged);
-- 
2.33.0
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin