https://bugs.kde.org/show_bug.cgi?id=511028

--- Comment #9 from Sebastian Sauer <[email protected]> ---
>From the attached backtrace:

> #0  0x00007fff6f09c14c in QObjectPrivate::connectImpl
>     (sender=sender@entry=0x5556001d0f00, signal_index=24, 
> receiver=receiver@entry=0x5556103b70c0, slot=slot@entry=0x7ffffd12e870, 
> slotObjRaw=slotObjRaw@entry=0x5556103b8690, type=type@entry=128, 
> types=types@entry=0x0, senderMetaObject=senderMetaObject@entry=0x7fff710890a8 
> <QQuickWindow::staticMetaObject>)
>     at /home/kde/kde/src/qtbase/src/corelib/kernel/qobject.cpp:5322

```
QMetaObject::Connection QObjectPrivate::connectImpl(...)
{
    if (c2->receiver.loadRelaxed() == receiver && c2->isSlotObject &&
c2->slotObj->compare(slot))
}
```

> #3  PlasmaTheme::syncWindow (this=0x5556103b70c0) at 
> /home/kde/kde/src/libplasma/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp:98

```
void PlasmaTheme::syncWindow()
{
    connect(qw, &QQuickWindow::sceneGraphInitialized, this,
&PlasmaTheme::syncWindow, Qt::UniqueConnection);
}
```

> #4  0x00007fff456e771c in PlasmaTheme::PlasmaTheme 
> (this=this@entry=0x5556103b70c0, parent=0x5556103b6840)
>     at 
> /home/kde/kde/src/libplasma/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp:56

```
PlasmaTheme::PlasmaTheme(QObject *parent)
{
    syncWindow();
}
```

Getting context:

```
git blame plasmatheme.cpp | grep sceneGraphInitialized
f40f745993 (Marco Martin             2025-03-24 14:09:54 +0000  98)            
connect(qw, &QQuickWindow::sceneGraphInitialized, this,
&PlasmaTheme::syncWindow, Qt::UniqueConnection);

git log f40f745993^..f40f745993
commit f40f7459938667e8c66bb0585d8df5957a59a979
Author: Marco Martin <[email protected]>
Date:   Mon Mar 24 14:09:54 2025 +0000

    Use Disabled Text color when needed

    With the same logic taken 1:1 from the plugin in qqc2-desktop-style,
    notice when the parent item or window is disabled, and change the text
    color accordingly

    BUG:501633
```

Comparing with qqc2-desktop-style I came up with:

```
diff --git a/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp
b/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp
index 1897a9344..dc230e2b6 100644
--- a/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp
+++ b/src/declarativeimports/kirigamiplasmastyle/plasmatheme.cpp
@@ -94,8 +94,12 @@ void PlasmaTheme::syncWindow()
         if (!window) {
             window = qw;
         }
-        if (qw) {
-            connect(qw, &QQuickWindow::sceneGraphInitialized, this,
&PlasmaTheme::syncWindow, Qt::UniqueConnection);
+
+        disconnect(m_sgConnection);
+        if (qw && !qw->isSceneGraphInitialized() && qw != m_window) {
+            m_sgConnection = connect(qw, &QQuickWindow::sceneGraphInitialized,
this, &PlasmaTheme::syncWindow);
+        } else if (!qw) {
+            m_sgConnection = QMetaObject::Connection();
         }
     }
     m_window = window;
diff --git a/src/declarativeimports/kirigamiplasmastyle/plasmatheme.h
b/src/declarativeimports/kirigamiplasmastyle/plasmatheme.h
index 462c8713d..ca645f326 100644
--- a/src/declarativeimports/kirigamiplasmastyle/plasmatheme.h
+++ b/src/declarativeimports/kirigamiplasmastyle/plasmatheme.h
@@ -38,6 +38,7 @@ protected:
 private:
     Plasma::Theme m_theme;
     QPointer<QWindow> m_window;
+    QMetaObject::Connection m_sgConnection;
 };

 #endif // PLASMATHEME_H
```

Unfortunately even with that patch applied the freeze still happens but now the
backtrace looks very strange :-/

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to