SmartPanelWindow: add a small delay in an attempt to improve cleanup

This commit is contained in:
ItsLemmy
2025-11-26 20:28:15 -05:00
parent ba1e783c8f
commit d2023500a9
+22 -1
View File
@@ -47,6 +47,9 @@ PanelWindow {
property bool closeWatchdogActive: false
property bool openWatchdogActive: false
// Delay before unloading content (helps with shader cleanup on older Qt versions)
property int contentUnloadDelay: 100
// Signals
signal panelOpened
signal panelClosed
@@ -176,13 +179,21 @@ PanelWindow {
closeWatchdogTimer.stop();
root.isPanelVisible = false;
// Delay unloading content to ensure shaders are properly cleaned up (helps with older Qt versions)
contentUnloadDelayTimer.start();
Logger.d("SmartPanelWindow", "Panel close finalized, delaying content unload", placeholder.panelName);
}
function completeContentUnload() {
root.isPanelOpen = false;
root.isClosing = false;
root.opacityFadeComplete = false;
PanelService.closedPanel(root);
panelClosed();
Logger.d("SmartPanelWindow", "Panel close finalized", placeholder.panelName);
Logger.d("SmartPanelWindow", "Content unloaded", placeholder.panelName);
}
// Fullscreen container for click-to-close and content
@@ -433,6 +444,16 @@ PanelWindow {
}
}
// Timer to delay content unloading after panel closes (helps with shader cleanup on older Qt)
Timer {
id: contentUnloadDelayTimer
interval: root.contentUnloadDelay
repeat: false
onTriggered: {
root.completeContentUnload();
}
}
// Watch for placeholder size animation completion to finalize close
Connections {
target: placeholder.panelItem