fix(bar): more bullet proofing toward auto-hide

This commit is contained in:
Lemmy
2026-03-13 13:49:31 -04:00
parent 8e346465cb
commit 4e814962a4
2 changed files with 34 additions and 4 deletions
+27 -2
View File
@@ -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;
+7 -2
View File
@@ -25,6 +25,8 @@ PanelWindow {
Component.onCompleted: {
Logger.d("BarContentWindow", "Bar content window created for screen:", barWindow.screen?.name);
if (!isHidden)
contentLoaded = true;
}
// Wayland layer configuration
@@ -144,8 +146,11 @@ PanelWindow {
right: barPosition === "right" || !barIsVertical
}
// Track if content should be loaded (stays true during fade-out animation)
property bool contentLoaded: !isHidden
// Track if content should be loaded (stays true during fade-out animation).
// Must NOT be a binding to isHidden — on the first hide cycle the binding
// would flip contentLoaded false synchronously (before onIsHiddenChanged can
// start the unload timer), unmapping the Wayland surface mid-animation.
property bool contentLoaded: false
// Timer to delay unload until after fade animation
Timer {