mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-25 01:40:57 +00:00
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.
This commit is contained in:
@@ -7184,6 +7184,14 @@ void Tab::activate_selected_page(std::function<void()> 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();
|
||||
|
||||
Reference in New Issue
Block a user