diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index bae013388d..d2c42b4441 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -818,6 +818,16 @@ void GridTestCase::ReadOnly() CPPUNIT_ASSERT(m_grid->IsReadOnly(1, 1)); m_grid->SetFocus(); + +#ifdef __WXGTK__ + // This is a mystery, but we somehow get WXK_RETURN generated by the + // previous test (Editable) in this one. In spite of wxYield() in that + // test, the key doesn't get dispatched there and we have to consume it + // here before setting the current grid cell, as getting WXK_RETURN later + // would move the selection down, to a non read-only cell. + wxYield(); +#endif // __WXGTK__ + m_grid->SetGridCursor(1, 1); CPPUNIT_ASSERT(m_grid->IsCurrentCellReadOnly());