mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
SmartPanelWindow: add a small delay in an attempt to improve cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user