Avoid 3d viewer stealing back focus/activation

Fix #6184
This commit is contained in:
Marek Roszko 2020-10-27 19:35:55 -04:00
parent 89f8078381
commit 04697c5fe8
1 changed files with 5 additions and 5 deletions

View File

@ -416,11 +416,11 @@ void EDA_3D_VIEWER::OnDisableRayTracing( wxCommandEvent& aEvent )
} }
void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event ) void EDA_3D_VIEWER::OnActivate( wxActivateEvent &aEvent )
{ {
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" ); wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" );
if( m_canvas ) if( aEvent.GetActive() && m_canvas )
{ {
// Reload data if 3D frame shows a board, // Reload data if 3D frame shows a board,
// because it can be changed since last frame activation // because it can be changed since last frame activation
@ -431,17 +431,17 @@ void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event )
m_canvas->SetFocus(); m_canvas->SetFocus();
} }
event.Skip(); // required under wxMAC aEvent.Skip(); // required under wxMAC
} }
void EDA_3D_VIEWER::OnSetFocus(wxFocusEvent &event) void EDA_3D_VIEWER::OnSetFocus( wxFocusEvent& aEvent )
{ {
// Activates again the focus of the canvas so it will catch mouse and key events // Activates again the focus of the canvas so it will catch mouse and key events
if( m_canvas ) if( m_canvas )
m_canvas->SetFocus(); m_canvas->SetFocus();
event.Skip(); aEvent.Skip();
} }