diff --git a/kicad/class_treeproject_item.cpp b/kicad/class_treeproject_item.cpp index 1aa2d8eca3..8a6e135a8a 100644 --- a/kicad/class_treeproject_item.cpp +++ b/kicad/class_treeproject_item.cpp @@ -173,7 +173,8 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe ) wxString fullFileName = GetFileName(); wxTreeItemId id = GetId(); - KICAD_MANAGER_FRAME* frame = (KICAD_MANAGER_FRAME*) Pgm().App().GetTopWindow(); + KICAD_MANAGER_FRAME* frame = prjframe->m_Parent; + wxASSERT( frame ); switch( GetType() ) {