Fix a compatibility issue with wxWidgets 3.1.2 (MSW specific)

This commit is contained in:
jean-pierre charras 2018-12-28 15:30:22 +01:00
parent 8cc3912b6c
commit 9f21d32563
1 changed files with 10 additions and 0 deletions

View File

@ -358,7 +358,17 @@ void CONTEXT_MENU::onMenuEvent( wxMenuEvent& aEvent )
wxMenu* menu = nullptr;
FindItem( m_selected, &menu );
// This conditional compilation is probably not needed.
// It will be removed later, for the Kicad V 6.x version.
// But in "old" 3.0 version, the "&& menu != this" contition was added to avoid hang
// This hang is no longer encountered in wxWidgets 3.0.4 version, and this condition is no longer needed.
// And in 3.1.2, we have to remove it, as "menu != this" never happens
// ("menu != this" always happens in 3.1.1 and older!).
#if wxCHECK_VERSION(3, 1, 2)
if( menu )
#else
if( menu && menu != this )
#endif
{
CONTEXT_MENU* cxmenu = static_cast<CONTEXT_MENU*>( menu );
evt = cxmenu->eventHandler( aEvent );