From 66435887eadea3f03b2044095334510a433480be Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 12 Aug 2021 12:51:27 +0200 Subject: [PATCH] Revert of the 84c6199015fde4a7e04fd4cd214580f9f1ac5091 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. --- src/slic3r/GUI/Plater.cpp | 2 ++ src/slic3r/Utils/FixModelByWin10.cpp | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b5a229276..b85cc3cd7 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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) diff --git a/src/slic3r/Utils/FixModelByWin10.cpp b/src/slic3r/Utils/FixModelByWin10.cpp index a3689d927..2fbd0d937 100644 --- a/src/slic3r/Utils/FixModelByWin10.cpp +++ b/src/slic3r/Utils/FixModelByWin10.cpp @@ -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 #include @@ -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;