mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(bar): more bullet proofing toward auto-hide
This commit is contained in:
@@ -73,8 +73,33 @@ Item {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
asynchronous: false
|
||||
// Include reloadCounter in the binding to force re-evaluation
|
||||
active: root.checkWidgetExists() && (root.reloadCounter >= 0)
|
||||
|
||||
// Deferred activation to prevent re-entrant incubation crash:
|
||||
// When ListModel.append() creates this delegate, the Repeater is mid-incubation.
|
||||
// If this Loader activates synchronously (asynchronous: false) during delegate
|
||||
// finalization, it triggers nested QQmlIncubatorPrivate::incubate which corrupts
|
||||
// the V4 heap (SIGSEGV in QV4::Object::insertMember).
|
||||
// Deferring to the next event loop iteration breaks the nesting.
|
||||
property bool _ready: false
|
||||
active: _ready && root.checkWidgetExists() && (root.reloadCounter >= 0)
|
||||
|
||||
Timer {
|
||||
id: activateTimer
|
||||
interval: 0
|
||||
onTriggered: loader._ready = true
|
||||
}
|
||||
|
||||
Component.onCompleted: activateTimer.start()
|
||||
|
||||
// Reset _ready when reloadCounter changes to force a deferred re-activation
|
||||
Connections {
|
||||
target: root
|
||||
function onReloadCounterChanged() {
|
||||
loader._ready = false;
|
||||
activateTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
sourceComponent: {
|
||||
// Depend on reloadCounter to force re-fetch of component
|
||||
var _ = root.reloadCounter;
|
||||
|
||||
Reference in New Issue
Block a user