diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index e25cf41511..a19bed05a8 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4739,11 +4739,19 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) void GLCanvas3D::on_paint(wxPaintEvent& evt) { - if (m_initialized) + if (m_initialized) { +#ifdef __WXMSW__ + // Idle events are not dispatched during the Windows resize modal loop, + // so render immediately to avoid blank frames. + _refresh_if_shown_on_screen(); + m_dirty = false; +#else m_dirty = true; - else +#endif + } else { // Call render directly, so it gets initialized immediately, not from On Idle handler. this->render(); + } } void GLCanvas3D::force_set_focus() { diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index a585bdac96..e820639899 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -428,7 +428,10 @@ wxGLCanvas* OpenGLManager::create_wxglcanvas(wxWindow& parent) if (! can_multisample()) attribList[12] = 0; - return new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS); + wxGLCanvas* canvas = new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS); + // The GL canvas paints its entire surface, so background erasing is unnecessary. + canvas->SetBackgroundStyle(wxBG_STYLE_PAINT); + return canvas; } void OpenGLManager::detect_multisample(int* attribList)