From d57b726c90f5a5a0afd96b58a44fdf9639c050e9 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 4 Sep 2023 22:21:39 +0100 Subject: [PATCH] Bug fix for lib-tree previews when lib-tree is hidden. --- common/widgets/lib_tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) ) {