diff --git a/src/edt/edt/edtInstPropertiesPage.cc b/src/edt/edt/edtInstPropertiesPage.cc index 08cab1159..da06cb814 100644 --- a/src/edt/edt/edtInstPropertiesPage.cc +++ b/src/edt/edt/edtInstPropertiesPage.cc @@ -35,6 +35,7 @@ #include "layLayoutViewBase.h" #include "layCellSelectionForm.h" #include "layQtTools.h" +#include "layBusy.h" #include "tlExceptions.h" #include "tlString.h" @@ -870,19 +871,21 @@ InstPropertiesPage::do_apply (bool current_only, bool relative) db::Instance new_inst = pos->back ().inst_ptr; // Don't apply the same change twice - std::map::const_iterator i = insts_seen.find (pos->back ().inst_ptr); + std::map::const_iterator i = insts_seen.find (new_inst); if (i == insts_seen.end ()) { + db::Instance org_inst = new_inst; + const lay::CellView &cv = mp_service->view ()->cellview (pos->cv_index ()); db::Cell &cell = cv->layout ().cell (pos->cell_index ()); double dbu = cv->layout ().dbu (); - if (!current_only || pos->back ().inst_ptr == current) { - new_inst = applicator->do_apply_inst (cell, pos->back ().inst_ptr, dbu, relative_mode); + if (!current_only || org_inst == current) { + new_inst = applicator->do_apply_inst (cell, org_inst, dbu, relative_mode); } - insts_seen.insert (std::make_pair (pos->back ().inst_ptr, new_inst)); + insts_seen.insert (std::make_pair (org_inst, new_inst)); } else { new_inst = i->second; diff --git a/src/edt/edt/edtPropertiesPageUtils.cc b/src/edt/edt/edtPropertiesPageUtils.cc index 46ef34d5f..2bb359eae 100644 --- a/src/edt/edt/edtPropertiesPageUtils.cc +++ b/src/edt/edt/edtPropertiesPageUtils.cc @@ -28,6 +28,7 @@ #include "dbLayout.h" #include "dbLibrary.h" #include "dbPCellDeclaration.h" +#include "layBusy.h" #include @@ -630,6 +631,10 @@ ChangeTargetPCellApplicator::ChangeTargetPCellApplicator (db::pcell_id_type pcel db::Instance ChangeTargetPCellApplicator::do_apply_inst (db::Cell &cell, const db::Instance &instance, double /*dbu*/, bool /*relative*/) const { + // Prevent recursion due to processEvents produced by macro code when + // executing inside the IDE + lay::BusySection busy; + tl_assert (cell.layout ()); db::Layout *layout = cell.layout (); diff --git a/src/edt/edt/edtServiceImpl.cc b/src/edt/edt/edtServiceImpl.cc index 53a0456f8..ba5f77723 100644 --- a/src/edt/edt/edtServiceImpl.cc +++ b/src/edt/edt/edtServiceImpl.cc @@ -38,6 +38,7 @@ #include "layMarker.h" #include "layLayerProperties.h" #include "layLayoutViewBase.h" +#include "layBusy.h" #if defined(HAVE_QT) # include "layLayoutView.h" @@ -1722,6 +1723,9 @@ InstService::make_cell (const lay::CellView &cv) return std::make_pair (true, m_current_cell); } + // prevents recursion + lay::BusySection busy; + // NOTE: do this at the beginning: creating a transaction might delete transactions behind the // head transaction, hence releasing (thus: deleting) cells. To prevert interference, create // the transaction at the beginning.