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);