mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
launcher: attempt at fixing potential crash when launching app
This commit is contained in:
@@ -160,7 +160,9 @@ SmartPanel {
|
||||
screen: root.screen
|
||||
isOpen: root.isPanelOpen
|
||||
onRequestClose: root.close()
|
||||
onRequestCloseImmediately: root.closeImmediately()
|
||||
// Defer so the signal emission completes before SmartPanel
|
||||
// sets isPanelOpen=false and the contentLoader destroys us.
|
||||
onRequestCloseImmediately: Qt.callLater(root.closeImmediately)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,7 @@ Rectangle {
|
||||
signal requestCloseImmediately
|
||||
|
||||
function closeImmediately() {
|
||||
// Must be deferred — SmartPanel.closeImmediately() sets isPanelOpen=false
|
||||
// which deactivates the contentLoader and destroys us mid-signal-chain.
|
||||
Qt.callLater(function () {
|
||||
requestCloseImmediately();
|
||||
});
|
||||
requestCloseImmediately();
|
||||
}
|
||||
|
||||
// Expose for preview panel positioning
|
||||
|
||||
@@ -547,9 +547,11 @@ Item {
|
||||
"_score": (score !== undefined ? score : 0),
|
||||
"provider": root,
|
||||
"onActivate": function () {
|
||||
// Record usage before closing (provider may be destroyed after close)
|
||||
// Defer usage recording — must run before closeImmediately's deferred
|
||||
// handler destroys us, but outside the delegate click call stack to
|
||||
// avoid property-change cascades mid-handler.
|
||||
if (Settings.data.appLauncher.sortByMostUsed) {
|
||||
root.recordUsage(app);
|
||||
Qt.callLater(() => root.recordUsage(app));
|
||||
}
|
||||
|
||||
// Close the launcher/SmartPanel immediately without any animations.
|
||||
|
||||
Reference in New Issue
Block a user