From 94bdb7402d232022fd0b6be251c94a6dc21348fe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 17 Oct 2019 22:03:44 +0200 Subject: [PATCH] Don't do anything in WaitForPaint class under non-GTK platforms Under MSW the tests pass even without it, so don't make them take longer unnecessarily. --- tests/waitforpaint.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/waitforpaint.h b/tests/waitforpaint.h index 2d749bcf79..481fcc8b9a 100644 --- a/tests/waitforpaint.h +++ b/tests/waitforpaint.h @@ -12,7 +12,11 @@ #include "wx/stopwatch.h" #include "wx/window.h" -// Class used to check if we received the (first) paint event. +// Class used to check if we received the (first) paint event: this is +// currently used under GTK only, as MSW doesn't seem to need to wait for the +// things to work, while under Mac nothing works anyhow. +#ifdef __WXGTK__ + class WaitForPaint { public: @@ -72,4 +76,21 @@ private: } m_handler; }; +#else // !__WXGTK__ + +class WaitForPaint +{ +public: + explicit WaitForPaint(wxWindow* WXUNUSED(win)) + { + } + + bool YieldUntilPainted(int WXUNUSED(timeoutInMS) = 250) const + { + return true; + } +}; + +#endif // __WXGTK__/!__WXGTK__ + #endif // _WX_TESTS_WAITFORPAINT_H_