fix: prevent top-level dock areas to be destroyed with [X] button

This commit is contained in:
guijar_m authored and wakonig_k committed 2024-12-23 15:59:10 +01:00
1 parent 5c83702382
commit 09cb08a233
2 files changed
+17

No files matched your search

+6
View File
@@ -249,6 +249,12 @@ def main():
def sigint_handler(*args):
# display message, for people to let it terminate gracefully
print("Caught SIGINT, exiting")
# first hide all top level windows
# this is to discriminate the cases between "user clicks on [X]"
# (which should be filtered, to not close -see BECDockArea-)
# or "app is asked to close"
for window in app.topLevelWidgets():
window.hide() # so, we know we can exit because it is hidden
app.quit()
signal.signal(signal.SIGINT, sigint_handler)