gnucash maint: macOS: Give GnuCash time to shut down gracefully.
John Ralls
jralls at code.gnucash.org
Sat Sep 5 20:01:04 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/cbf2a7b9 (commit)
from https://github.com/Gnucash/gnucash/commit/706277e6 (commit)
commit cbf2a7b9f1a90eb458a070016e1bf5f21dad364d
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 5 17:00:56 2020 -0700
macOS: Give GnuCash time to shut down gracefully.
Instead of letting macOS pull the rug out.
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 5892130e6..6b1a896b9 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -3705,14 +3705,17 @@ gnc_quartz_shutdown (GtkosxApplication *theApp, gpointer data)
{
/* Do Nothing. It's too late. */
}
-/* Should quit responds to NSApplicationBlockTermination; returning
- * TRUE means "don't terminate", FALSE means "do terminate".
+/* Should quit responds to NSApplicationBlockTermination; returning TRUE means
+ * "don't terminate", FALSE means "do terminate". gnc_main_window_quit() queues
+ * a timer that starts an orderly shutdown in 250ms and if we tell macOS it's OK
+ * to quit GnuCash gets terminated instead of doing its orderly shutdown,
+ * leaving the book locked.
*/
static gboolean
gnc_quartz_should_quit (GtkosxApplication *theApp, GncMainWindow *window)
{
if (gnc_main_window_all_finish_pending())
- return !gnc_main_window_quit (window);
+ gnc_main_window_quit (window);
return TRUE;
}
Summary of changes:
gnucash/gnome-utils/gnc-main-window.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list