mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 00:47:34 +08:00
Make Window::Refresh test more robust under Mac
Fix CI test failure which started happening in this test after the
addition of Window::ContextHelpCaptureLost in e04e3260fc (Handle
context-help mouse capture loss, 2026-07-08) because the child window
that was not supposed to be repainted still was, as the entire window
needed a refresh.
Refresh and update it before starting the test to make it pass again
reliably.
See #26726.
This commit is contained in:
@@ -560,6 +560,15 @@ TEST_CASE_METHOD(WindowTestCase, "Window::SizerErrors", "[window][sizer][error]"
|
||||
TEST_CASE_METHOD(WindowTestCase, "Window::Refresh", "[window]")
|
||||
{
|
||||
wxWindow* const parent = m_window;
|
||||
|
||||
// Ensure that the window doesn't need a redraw before starting this test:
|
||||
// it could need one if some other window overlapping it created by a
|
||||
// previously running test was destroyed but this window was not repainted
|
||||
// after that yet. Without this, child1 could still get repainted even if
|
||||
// we don't refresh it and this is exactly what happened under Mac.
|
||||
parent->Refresh();
|
||||
wxYield();
|
||||
|
||||
wxWindow* const child1 = new wxWindow(parent, wxID_ANY, wxPoint(10, 20), wxSize(80, 50));
|
||||
wxWindow* const child2 = new wxWindow(parent, wxID_ANY, wxPoint(110, 20), wxSize(80, 50));
|
||||
wxWindow* const child3 = new wxWindow(parent, wxID_ANY, wxPoint(210, 20), wxSize(80, 50));
|
||||
|
||||
Reference in New Issue
Block a user