From 87a5d20d4cf5d32a6626e849a1cd86debf097835 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Thu, 24 Sep 2026 15:37:46 -0500 Subject: [PATCH] fix(gtk): crash at startup when opening a project with Home as the start page (#15876) Since #15811 the settings page is built when its tab is shown, so on a Home start that opens a project the Quality page is built on screen. Its flow-compensation-model field is a multiline text view that GTK maps as it is created and that is hidden, because compensation is off, before GTK first allocates it. The loading dialog's wxWindowDisabler then desensitizes the frame, and GTK crashes in gtk_text_layout_cursors_changed() on that text view. On GTK the page view is now hidden while a page is built, so a control that starts hidden is never realized and GTK realizes it when it is shown. The deferred build is unchanged. --- src/slic3r/GUI/Tab.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 78b974c86d..3974ca9ffd 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -7184,6 +7184,14 @@ void Tab::activate_selected_page(std::function throw_if_canceled) if (!m_active_page) return; +#ifdef __WXGTK__ + // Builds the page off screen, since GTK crashes when it desensitizes a multiline text view + // that was built on screen and hidden before its first size allocation. + const bool hide_view = m_active_page->build_pending() && m_page_view->IsShown(); + if (hide_view) + m_page_view->Hide(); + ScopeGuard show_view([this, hide_view] { if (hide_view) m_page_view->Show(); }); +#endif m_active_page->activate(m_mode, throw_if_canceled); update_changed_ui(); update_description_lines();