Fix hangs when trying to edit printer (#11714)

On linux, some users report that attempting to edit the printer
caused OrcaSlicer to hang.

Co-Authored-By: Ian Bassi <12130714+ianalexis@users.noreply.github.com>
This commit is contained in:
Christopher R. Palmer
2026-01-06 14:55:36 -05:00
co-authored by Ian Bassi
parent ba5f0e707d
commit 3fecf916c1
+3
View File
@@ -1714,11 +1714,14 @@ Sidebar::Sidebar(Plater *parent)
p->editing_filament = -1; p->editing_filament = -1;
if (p->combo_printer->switch_to_tab()) if (p->combo_printer->switch_to_tab())
p->editing_filament = 0; p->editing_filament = 0;
wxGetApp().CallAfter([this, panel_color]() {
// ORCA clicking edit button not triggers wxEVT_KILL_FOCUS wxEVT_LEAVE_WINDOW make changes manually to prevent stucked colors when opening printer settings // ORCA clicking edit button not triggers wxEVT_KILL_FOCUS wxEVT_LEAVE_WINDOW make changes manually to prevent stucked colors when opening printer settings
p->panel_printer_preset->SetBorderColor(panel_color.bd_normal); p->panel_printer_preset->SetBorderColor(panel_color.bd_normal);
p->btn_edit_printer->Hide(); p->btn_edit_printer->Hide();
p->panel_printer_preset->Layout(); p->panel_printer_preset->Layout();
}); });
});
ScalableBitmap bitmap_printer(p->panel_printer_preset, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight()); ScalableBitmap bitmap_printer(p->panel_printer_preset, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight());
p->image_printer = new wxStaticBitmap(p->panel_printer_preset, wxID_ANY, bitmap_printer.bmp(), wxDefaultPosition, FromDIP(PRINTER_THUMBNAIL_SIZE), 0); p->image_printer = new wxStaticBitmap(p->panel_printer_preset, wxID_ANY, bitmap_printer.bmp(), wxDefaultPosition, FromDIP(PRINTER_THUMBNAIL_SIZE), 0);