From 04697c5fe80ce92a994480697255f43d1138bf87 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 27 Oct 2020 19:35:55 -0400 Subject: [PATCH] Avoid 3d viewer stealing back focus/activation Fix #6184 --- 3d-viewer/3d_viewer/eda_3d_viewer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index 6f8323514b..b0f3a96394 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -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" ); - if( m_canvas ) + if( aEvent.GetActive() && m_canvas ) { // Reload data if 3D frame shows a board, // because it can be changed since last frame activation @@ -431,17 +431,17 @@ void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event ) 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 if( m_canvas ) m_canvas->SetFocus(); - event.Skip(); + aEvent.Skip(); }