From 3fcb45eb355b96cbe2179182cc8ff7512d30eb30 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 12 Dec 2024 14:22:02 -0800 Subject: [PATCH] Bug 799458 - Crash attempting to edit a scheduled transaction Caused by arbitrarily casting a random GtkBox to GncMainWindow. Get the GtkBox's parent main window instead. --- gnucash/gnome-utils/gnc-plugin-page.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c index bd02abe3d45..d7a2e251322 100644 --- a/gnucash/gnome-utils/gnc-plugin-page.c +++ b/gnucash/gnome-utils/gnc-plugin-page.c @@ -39,6 +39,7 @@ #include "gnc-plugin.h" #include "gnc-plugin-page.h" #include "gnc-gobject-utils.h" +#include "gnc-ui.h" /** The debugging module that this .o belongs to. */ static QofLogModule log_module = GNC_MOD_GUI; @@ -891,7 +892,7 @@ gnc_plugin_page_inserted_cb (GncPluginPage *page, gpointer user_data) page); // on initial load try and set the page focus - if (!gnc_main_window_is_restoring_pages (GNC_MAIN_WINDOW(page->window))) + if (!gnc_main_window_is_restoring_pages (GNC_MAIN_WINDOW (gnc_ui_get_main_window (page->window)))) (GNC_PLUGIN_PAGE_GET_CLASS(page)->focus_page)(page, TRUE); }