diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 60722f0ce2..799f35fd10 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -17,6 +17,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/app.h" #include "wx/dialog.h" #include "wx/frame.h" #include "wx/textctrl.h" @@ -32,6 +33,7 @@ static void TopLevelWindowShowTest(wxTopLevelWindow* tlw) // only run this test on platforms where ShowWithoutActivating is implemented. #if defined(__WXMSW__) || defined(__WXMAC__) + wxTheApp->GetTopWindow()->SetFocus(); tlw->ShowWithoutActivating(); CHECK(tlw->IsShown()); CHECK(!tlw->IsActive()); @@ -53,7 +55,7 @@ static void TopLevelWindowShowTest(wxTopLevelWindow* tlw) tlw->Hide(); CHECK(!tlw->IsShown()); #ifndef __WXGTK__ - CHECK(tlw->IsActive()); + CHECK(!tlw->IsActive()); #endif }