From 7ea1568802bb51f6dd02abbb34c79afe92901424 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Mon, 5 Feb 2024 12:39:50 +0000 Subject: [PATCH] Fix selection tool behavior in footprint viewer The footprint viewer isn't an edit frame, so we need to access the settings through the base frame type instead. Also, double click makes no sense in the footprint viewer, and just leads to weird results sometimes. Fixes Sentry KICAD-7A2 --- pcbnew/tools/pcb_selection_tool.cpp | 7 +++++++ pcbnew/tools/pcb_selection_tool.h | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 4d7196bd78..6388dfa23f 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -354,6 +354,13 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { m_disambiguateTimer.Stop(); + // Double clicks make no sense in the footprint viewer + if( frame && frame->IsType( FRAME_FOOTPRINT_VIEWER ) ) + { + evt->SetPassEvent(); + continue; + } + // Double click? Display the properties window m_frame->FocusOnItem( nullptr ); diff --git a/pcbnew/tools/pcb_selection_tool.h b/pcbnew/tools/pcb_selection_tool.h index c9efce4cf1..33e86566c9 100644 --- a/pcbnew/tools/pcb_selection_tool.h +++ b/pcbnew/tools/pcb_selection_tool.h @@ -232,7 +232,12 @@ protected: return getViewControls(); } - PCB_BASE_EDIT_FRAME* frame() const + PCB_BASE_FRAME* frame() const + { + return getEditFrame(); + } + + PCB_BASE_EDIT_FRAME* editFrame() const { return getEditFrame(); }