From dc99faa096f2866eeab39aeac5df6a8a1e01c657 Mon Sep 17 00:00:00 2001 From: Ilya Sinitsyn Date: Thu, 10 Oct 2019 00:43:34 +0700 Subject: [PATCH] Fix focus issue with composite grid editor windows The grid editor window can be composite, so check whether it or one of its children focus has focus when determining whether we should set the focus to the grid when the grid editor is being hidden, otherwise the focus was simply lost when such an editor was hidden. Closes https://github.com/wxWidgets/wxWidgets/pull/1599 --- src/generic/grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 447efc3d9e..7ae8040aef 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -7088,7 +7088,7 @@ void wxGrid::HideCellEditControl() wxGridCellAttr *attr = GetCellAttr(row, col); wxGridCellEditor *editor = attr->GetEditor(this, row, col); - const bool editorHadFocus = editor->GetWindow()->HasFocus(); + const bool editorHadFocus = editor->GetWindow()->IsDescendant(FindFocus()); if ( editor->GetWindow()->GetParent() != m_gridWin ) editor->GetWindow()->Reparent(m_gridWin);