Note: When ProgressDialog has no-nullptr parent, then PrusaSlicer doesn't lose the focus at the end of model fixing,
but start to flickering during fixing of the big models.
This commit is contained in:
YuSanka 2021-08-12 12:51:27 +02:00
parent 37ba18a8c3
commit 66435887ea
2 changed files with 3 additions and 3 deletions

View File

@ -3503,6 +3503,8 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* =
ModelObject* mo = model.objects[obj_idx];
fix_model_by_win10_sdk_gui(*mo, vol_idx);
q->changed_mesh(obj_idx);
// workaround to fix the issue, when PrusaSlicer lose a focus after model fixing
q->SetFocus();
}
void Plater::priv::set_current_panel(wxPanel* panel)

View File

@ -36,8 +36,6 @@
#include "../GUI/GUI.hpp"
#include "../GUI/I18N.hpp"
#include "../GUI/MsgDialog.hpp"
#include "../GUI/GUI_App.hpp"
#include "../GUI/MainFrame.hpp"
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
@ -343,7 +341,7 @@ void fix_model_by_win10_sdk_gui(ModelObject &model_object, int volume_idx)
wxProgressDialog progress_dialog(
_L("Model fixing"),
_L("Exporting model") + "...",
100, GUI::wxGetApp().mainframe, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
100, nullptr, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); // ! parent of the wxProgressDialog should be nullptr to avoid flickering during the model fixing
// Executing the calculation in a background thread, so that the COM context could be created with its own threading model.
// (It seems like wxWidgets initialize the COM contex as single threaded and we need a multi-threaded context).
bool success = false;