diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index b675223293..fc1a9ce9ff 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -455,8 +455,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) if( isMouseClick( type ) ) { - if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() ) + if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() && + !m_toolMgr->GetToolHolder()->GetToolCanvas()->HasFocus() ) + { m_toolMgr->GetToolHolder()->GetToolCanvas()->SetFocus(); + } } // Mouse handling diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index 7835a587d1..b69dbd9a4e 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -424,14 +424,19 @@ void PROPERTIES_PANEL::onShow( wxShowEvent& aEvent ) { if( aEvent.IsShown() ) UpdateData(); + + aEvent.Skip(); } void PROPERTIES_PANEL::onCharHook( wxKeyEvent& aEvent ) { - if( aEvent.GetKeyCode() == WXK_TAB && !aEvent.ShiftDown() ) + if( aEvent.GetKeyCode() == WXK_TAB && !aEvent.ShiftDown() && m_grid->IsAnyModified() ) { m_grid->CommitChangesFromEditor(); + + // Pass the tab key on so the default property grid tab behavior is honored. + aEvent.Skip(); return; } diff --git a/common/widgets/properties_panel.h b/common/widgets/properties_panel.h index 7f15c48a4f..cac6cd9bec 100644 --- a/common/widgets/properties_panel.h +++ b/common/widgets/properties_panel.h @@ -78,8 +78,8 @@ protected: virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0; // Event handlers - virtual void valueChanging( wxPropertyGridEvent& aEvent ) {} - virtual void valueChanged( wxPropertyGridEvent& aEvent ) {} + virtual void valueChanging( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); } + virtual void valueChanged( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); } void onCharHook( wxKeyEvent& aEvent ); void onShow( wxShowEvent& aEvent ); diff --git a/eeschema/widgets/sch_properties_panel.cpp b/eeschema/widgets/sch_properties_panel.cpp index c3b745a8b7..260ba62724 100644 --- a/eeschema/widgets/sch_properties_panel.cpp +++ b/eeschema/widgets/sch_properties_panel.cpp @@ -115,11 +115,6 @@ void SCH_PROPERTIES_PANEL::AfterCommit() const SELECTION& selection = selectionTool->GetSelection(); rebuildProperties( selection ); - - CallAfter( [this]() - { - m_frame->GetCanvas()->SetFocus(); - } ); } @@ -175,6 +170,8 @@ void SCH_PROPERTIES_PANEL::valueChanging( wxPropertyGridEvent& aEvent ) aEvent.Veto(); return; } + + aEvent.Skip(); } @@ -204,6 +201,8 @@ void SCH_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent ) // Perform grid updates as necessary based on value change AfterCommit(); + + aEvent.Skip(); } @@ -211,6 +210,8 @@ void SCH_PROPERTIES_PANEL::OnLanguageChanged( wxCommandEvent& aEvent ) { PROPERTIES_PANEL::OnLanguageChanged( aEvent ); updateFontList(); + + aEvent.Skip(); } diff --git a/pcbnew/widgets/pcb_properties_panel.cpp b/pcbnew/widgets/pcb_properties_panel.cpp index cf28a63885..55826c4964 100644 --- a/pcbnew/widgets/pcb_properties_panel.cpp +++ b/pcbnew/widgets/pcb_properties_panel.cpp @@ -120,11 +120,6 @@ void PCB_PROPERTIES_PANEL::AfterCommit() const SELECTION& selection = selectionTool->GetSelection(); rebuildProperties( selection ); - - CallAfter( [this]() - { - static_cast( m_frame )->GetCanvas()->SetFocus(); - } ); }