diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 55627b9015..4a0f1743fb 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4258,6 +4258,10 @@ void GLCanvas3D::on_paint(wxPaintEvent& evt) this->render(); } +void GLCanvas3D::force_set_focus() { + m_canvas->SetFocus(); +}; + void GLCanvas3D::on_set_focus(wxFocusEvent& evt) { m_tooltip_enabled = false; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 26cabafbd1..47354060a3 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -894,6 +894,7 @@ public: void on_gesture(wxGestureEvent& evt); void on_paint(wxPaintEvent& evt); void on_set_focus(wxFocusEvent& evt); + void force_set_focus(); Size get_canvas_size() const; Vec2d get_local_mouse_position() const; diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 739ed367ce..a9bab53430 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -385,9 +385,9 @@ void Preview::sys_color_changed() void Preview::on_tick_changed(Type type) { - if (type == Type::PausePrint) { - m_schedule_background_process(); - } + //if (type == Type::PausePrint) { + // m_schedule_background_process(); + //} m_keep_current_preview_type = false; reload_print(false); } diff --git a/src/slic3r/GUI/IMSlider.cpp b/src/slic3r/GUI/IMSlider.cpp index 77be50a92c..132e99e812 100644 --- a/src/slic3r/GUI/IMSlider.cpp +++ b/src/slic3r/GUI/IMSlider.cpp @@ -1306,6 +1306,7 @@ void IMSlider::render_input_custom_gcode() set_focus = false; } if (set_focus && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)) { + wxGetApp().plater()->get_current_canvas3D()->force_set_focus(); ImGui::SetKeyboardFocusHere(0); } const int text_height = 6; @@ -1385,6 +1386,7 @@ void IMSlider::render_go_to_layer_dialog() set_focus = false; } if (set_focus && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)) { + wxGetApp().plater()->get_current_canvas3D()->force_set_focus(); ImGui::SetKeyboardFocusHere(0); } ImGui::InputText("##input_layer_number", m_layer_number, sizeof(m_layer_number)); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f41ab6b887..206077b65f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2400,7 +2400,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) preview->on_tick_changed(tick_event_type); // BBS set to invalid state only - if (tick_event_type == Type::ToolChange || tick_event_type == Type::Custom || tick_event_type == Type::Template) { + if (tick_event_type == Type::ToolChange || tick_event_type == Type::Custom || tick_event_type == Type::Template || tick_event_type == Type::PausePrint) { PartPlate *plate = this->q->get_partplate_list().get_curr_plate(); if (plate) { plate->update_slice_result_valid_state(false);