From c9e35a59dc037cbf677c0330f21511debca5545d Mon Sep 17 00:00:00 2001 From: John Beard Date: Tue, 22 Apr 2025 00:26:18 +0800 Subject: [PATCH] PCB_PICKER_TOOL: avoid popping a dismabiguation menu after point selection completes Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20680 (cherry picked from commit 207199fd8057c7999f366f24917a52dfc68cfa06) --- pcbnew/tools/pcb_picker_tool.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/tools/pcb_picker_tool.cpp b/pcbnew/tools/pcb_picker_tool.cpp index 892b687632..72ca54ba0f 100644 --- a/pcbnew/tools/pcb_picker_tool.cpp +++ b/pcbnew/tools/pcb_picker_tool.cpp @@ -247,6 +247,9 @@ int PCB_PICKER_TOOL::SelectPointInteractively( const TOOL_EVENT& aEvent ) PCB_GRID_HELPER grid_helper( m_toolMgr, frame()->GetMagneticItemsSettings() ); + // By pushing this tool, we stop the Selection tool popping a disambiuation menu + // in cases like returning to the Position Relative dialog after the selection. + frame()->PushTool( aEvent ); Activate(); statusPopup.SetText( wxGetTranslation( params.m_Prompt ) ); @@ -294,6 +297,7 @@ int PCB_PICKER_TOOL::SelectPointInteractively( const TOOL_EVENT& aEvent ) Main( aEvent ); canvas()->SetStatusPopup( nullptr ); + frame()->PopTool( aEvent ); return 0; } @@ -306,6 +310,7 @@ int PCB_PICKER_TOOL::SelectItemInteractively( const TOOL_EVENT& aEvent ) PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + frame()->PushTool( aEvent ); Activate(); statusPopup.SetText( wxGetTranslation( params.m_Prompt ) ); @@ -365,6 +370,7 @@ int PCB_PICKER_TOOL::SelectItemInteractively( const TOOL_EVENT& aEvent ) Main( aEvent ); canvas()->SetStatusPopup( nullptr ); + frame()->PopTool( aEvent ); return 0; }