From 125ea73adf21784fe4a7a3882606d3542470c388 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 14 Sep 2022 21:02:00 -0400 Subject: [PATCH] Avoid refreshing the search when the panel isn't open --- pcbnew/widgets/pcb_search_pane.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pcbnew/widgets/pcb_search_pane.cpp b/pcbnew/widgets/pcb_search_pane.cpp index 9ccc2ad5d2..fb4fc46f8d 100644 --- a/pcbnew/widgets/pcb_search_pane.cpp +++ b/pcbnew/widgets/pcb_search_pane.cpp @@ -75,24 +75,36 @@ void PCB_SEARCH_PANE::onBoardChanged( wxCommandEvent& event ) void PCB_SEARCH_PANE::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { + if( !IsShown() ) + return; + RefreshSearch(); } void PCB_SEARCH_PANE::OnBoardItemsAdded( BOARD& aBoard, std::vector& aBoardItems ) { + if( !IsShown() ) + return; + RefreshSearch(); } void PCB_SEARCH_PANE::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { + if( !IsShown() ) + return; + RefreshSearch(); } void PCB_SEARCH_PANE::OnBoardItemsRemoved( BOARD& aBoard, std::vector& aBoardItems ) { + if( !IsShown() ) + return; + RefreshSearch(); } @@ -104,12 +116,18 @@ void PCB_SEARCH_PANE::OnBoardNetSettingsChanged( BOARD& aBoard ) void PCB_SEARCH_PANE::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { + if( !IsShown() ) + return; + RefreshSearch(); } void PCB_SEARCH_PANE::OnBoardItemsChanged( BOARD& aBoard, std::vector& aBoardItems ) { + if( !IsShown() ) + return; + RefreshSearch(); }