Tear down the Design canvas at shutdown

The Design tab's viewport is the fourth GLCanvas3D on the shared GL context and
the only one the plater does not own, so unbind_canvas_event_handlers() and
reset_canvas_volumes() never reached it — the macOS Command+Q and Debian cases
those calls exist for. Its frame-level handlers become members so they can be
unbound.
This commit is contained in:
SoftFever
2026-08-31 18:04:12 +08:00
parent 5a4f7f4c3c
commit 493befecc5
5 changed files with 88 additions and 17 deletions
+11
View File
@@ -6991,6 +6991,17 @@ void DesignPanel::on_tab_shown()
if (m_viewport) m_viewport->force_repaint(); // the page was just re-shown: paint it for real
}
// Application close / language switch, from the plater's canvas teardown.
void DesignPanel::unbind_canvas_event_handlers()
{
if (m_viewport) m_viewport->unbind_canvas_event_handlers();
}
void DesignPanel::reset_canvas_volumes()
{
if (m_viewport) m_viewport->reset_canvas_volumes();
}
// Match Prepare's sidebar width instead of hardcoding one. Design used a fixed 264 px against
// Prepare's ~467, so the canvas edge jumped sideways on every tab switch; reading the live width
// also means the two stay aligned if Orca ever changes its sidebar.