From 228fe71eb45b49c0d219f90fa8a7677104587683 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 23 Jun 2023 08:09:49 -0400 Subject: [PATCH] Do not force focus on dataview in RC dialogs On GTK, this causes the first item to be selected, firing the selection handler and causing unwanted side effects. Fixes https://gitlab.com/kicad/code/kicad/-/issues/11925 (cherry picked from commit 7804c2177cd90f00d7418a82022fda0cedb81c0c) --- eeschema/dialogs/dialog_erc.cpp | 2 ++ pcbnew/dialogs/dialog_drc.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index d39d46b019..aafa4edb30 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -438,7 +438,9 @@ void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event ) { wxMilliSleep( 500 ); m_runningResultsBook->ChangeSelection( 1 ); +#ifndef __WXGTK__ KIPLATFORM::UI::ForceFocus( m_markerDataView ); +#endif } m_ercRun = true; diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index b208bd7c8c..5f3c9a4b29 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -325,7 +325,9 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent ) { wxMilliSleep( 500 ); m_runningResultsBook->ChangeSelection( 1 ); +#ifndef __WXGTK__ KIPLATFORM::UI::ForceFocus( m_markerDataView ); +#endif } refreshEditor();