mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
So we are applying a workaround here, just on linux.
This commit is contained in:
parent
8105fc33d5
commit
213ff2852a
2 changed files with 14 additions and 12 deletions
|
@ -354,23 +354,14 @@ void Preview::load_print(bool keep_z_range)
|
||||||
|
|
||||||
void Preview::reload_print(bool keep_volumes)
|
void Preview::reload_print(bool keep_volumes)
|
||||||
{
|
{
|
||||||
#ifndef __linux__
|
#ifdef __linux__
|
||||||
if (m_volumes_cleanup_required || !keep_volumes)
|
// We are getting mysterious crashes on Linux in gtk due to OpenGL context activation GH #1874 #1955.
|
||||||
{
|
// So we are applying a workaround here: a delayed release of OpenGL vertex buffers.
|
||||||
m_canvas->reset_volumes();
|
|
||||||
m_canvas->reset_legend_texture();
|
|
||||||
m_loaded = false;
|
|
||||||
m_volumes_cleanup_required = false;
|
|
||||||
}
|
|
||||||
#endif // __linux__
|
|
||||||
|
|
||||||
if (!IsShown())
|
if (!IsShown())
|
||||||
{
|
{
|
||||||
m_volumes_cleanup_required = !keep_volumes;
|
m_volumes_cleanup_required = !keep_volumes;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
if (m_volumes_cleanup_required || !keep_volumes)
|
if (m_volumes_cleanup_required || !keep_volumes)
|
||||||
{
|
{
|
||||||
m_canvas->reset_volumes();
|
m_canvas->reset_volumes();
|
||||||
|
@ -378,6 +369,13 @@ void Preview::reload_print(bool keep_volumes)
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
m_volumes_cleanup_required = false;
|
m_volumes_cleanup_required = false;
|
||||||
}
|
}
|
||||||
|
#else // __linux__
|
||||||
|
if (!keep_volumes)
|
||||||
|
{
|
||||||
|
m_canvas->reset_volumes();
|
||||||
|
m_canvas->reset_legend_texture();
|
||||||
|
m_loaded = false;
|
||||||
|
}
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
|
|
||||||
load_print();
|
load_print();
|
||||||
|
|
|
@ -84,7 +84,11 @@ class Preview : public wxPanel
|
||||||
BackgroundSlicingProcess* m_process;
|
BackgroundSlicingProcess* m_process;
|
||||||
GCodePreviewData* m_gcode_preview_data;
|
GCodePreviewData* m_gcode_preview_data;
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
// We are getting mysterious crashes on Linux in gtk due to OpenGL context activation GH #1874 #1955.
|
||||||
|
// So we are applying a workaround here.
|
||||||
bool m_volumes_cleanup_required;
|
bool m_volumes_cleanup_required;
|
||||||
|
#endif /* __linux__ */
|
||||||
|
|
||||||
// Calling this function object forces Plater::schedule_background_process.
|
// Calling this function object forces Plater::schedule_background_process.
|
||||||
std::function<void()> m_schedule_background_process;
|
std::function<void()> m_schedule_background_process;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue