diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index e98cbc0f25..2fe7350a6c 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -649,7 +649,7 @@ void LIB_TREE::onIdle( wxIdleEvent& aEvent ) wxWindow* topLevelFocus = wxGetTopLevelParent( wxWindow::FindFocus() ); wxPoint screenPos = wxGetMousePosition(); - wxRect screenRect = m_tree_ctrl->GetScreenRect(); + wxRect screenRect = m_tree_ctrl->IsShown() ? m_tree_ctrl->GetScreenRect() : wxRect(); if( topLevelFocus != topLevelParent || !screenRect.Contains( screenPos ) ) {