Make sure the menu bar gets activated (ie: don't eat the activate event).

Fixes: lp:1841560
* https://bugs.launchpad.net/kicad/+bug/1841560
This commit is contained in:
Jeff Young 2019-08-27 13:51:01 +01:00
parent a5a237ac32
commit 559035a7f6
2 changed files with 31 additions and 22 deletions

View File

@ -702,6 +702,8 @@ void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event )
{
if( event.GetActive() )
{
bool changed = m_libList ? ReCreateListLib() : false;
@ -713,6 +715,9 @@ void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event )
DisplayLibInfos();
}
event.Skip(); // required under wxMAC
}
void LIB_VIEW_FRAME::CloseLibraryViewer( wxCommandEvent& event )
{

View File

@ -751,31 +751,35 @@ void FOOTPRINT_VIEWER_FRAME::setCurFootprintName( const wxString& aName )
void FOOTPRINT_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
{
// Ensure we do not have old selection:
if( !event.GetActive() )
return;
if( event.GetActive() )
{
// Ensure we have the right library list:
std::vector< wxString > libNicknames = Prj().PcbFootprintLibs()->GetLogicalLibs();
bool stale = false;
if( libNicknames.size() == m_libList->GetCount() )
if( libNicknames.size() != m_libList->GetCount() )
stale = true;
else
{
unsigned ii;
for( ii = 0; ii < libNicknames.size(); ii++ )
for( unsigned ii = 0; ii < libNicknames.size(); ii++ )
{
if( libNicknames[ii] != m_libList->GetString( ii ) )
{
stale = true;
break;
}
if( ii == libNicknames.size() )
return;
}
}
// If we are here, the library list has changed, rebuild it
if( stale )
{
ReCreateLibraryList();
UpdateTitle();
}
}
event.Skip(); // required under wxMAC
}
void FOOTPRINT_VIEWER_FRAME::OnUpdateFootprintButton( wxUpdateUIEvent& aEvent )