From 0dfbfa62df47e7552f96f0b2f0359788a241d494 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 10 Oct 2019 11:03:55 +0200 Subject: [PATCH 1/2] wxExtensions.cpp: BitmapChoiceRenderer now updates config immediately after its combobox closes This was needed because for some reason, the combobox would not lose focus when mouse left the ObjectList on Linux (KILL_FOCUS forces the update). The update could be bypassed on Win too by changing extruder and hitting shortcut to reslice. --- src/slic3r/GUI/wxExtensions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index f1b658867..06e37fb4f 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -2179,7 +2179,12 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR c_editor->SetSelection(atoi(data.GetText().c_str())); // to avoid event propagation to other sidebar items - c_editor->Bind(wxEVT_COMBOBOX, [](wxCommandEvent& evt) { evt.StopPropagation(); }); + c_editor->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& evt) { + evt.StopPropagation(); + // FinishEditing grabs new selection and triggers config update. We better call + // it explicitly, automatic update on KILL_FOCUS didn't work on Linux. + this->FinishEditing(); + }); return c_editor; } From e51d970b2e04148e272b3bcab67b14a755f944d2 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 10 Oct 2019 14:44:52 +0200 Subject: [PATCH 2/2] Fixed crash in Plater::priv::can_reload_from_disk() --- src/slic3r/GUI/Plater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 50621caa8..cca164ca3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3835,9 +3835,9 @@ bool Plater::priv::can_reload_from_disk() const for (unsigned int idx : selected_volumes_idxs) { const GLVolume* v = selection.get_volume(idx); - int o_idx = v->object_idx(); int v_idx = v->volume_idx(); - selected_volumes.push_back({ o_idx, v_idx }); + if (v_idx >= 0) + selected_volumes.push_back({ v->object_idx(), v_idx }); } std::sort(selected_volumes.begin(), selected_volumes.end()); selected_volumes.erase(std::unique(selected_volumes.begin(), selected_volumes.end()), selected_volumes.end());