From 54c2d9df835532d0807b6f6549ecf43f03360475 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 27 Aug 2026 10:00:47 -0400 Subject: [PATCH] Fix Window::Refresh test: skip child-not-painted check on Wayland GTK3 with a native Wayland backend doesn't support partial redraws at all: any invalidation anywhere ends up repainting every window with its own full bounds, so the check that a non-intersecting child stays unpainted can never hold there. Skip it in that case, based on the actual X11-vs-Wayland backend rather than the platform, since e.g. a plain X11/XWayland session with a compositor does support this. --- tests/controls/windowtest.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/controls/windowtest.cpp b/tests/controls/windowtest.cpp index dd5822a764..c063fe6ed2 100644 --- a/tests/controls/windowtest.cpp +++ b/tests/controls/windowtest.cpp @@ -30,6 +30,10 @@ #include "wx/tooltip.h" #include "wx/wupdlock.h" +#ifdef __WXGTK__ + #include "wx/gtk/private/backend.h" +#endif // __WXGTK__ + class WindowTestCase { @@ -627,9 +631,15 @@ TEST_CASE_METHOD(WindowTestCase, "Window::Refresh", "[window]") WaitFor("parent repaint", [&]() { return isParentPainted; }, 100); // child1 should be the only window not to receive the wxEVT_PAINT event - // because it does not intersect with the refreshed rectangle. + // because it does not intersect with the refreshed rectangle. However, + // GTK3 with a native Wayland backend doesn't support partial redraws at + // all: any invalidation anywhere ends up repainting every window with + // its own full bounds, so don't check this there. +#ifdef __WXGTK3__ + if ( wxGTKImpl::IsX11(nullptr) ) +#endif // __WXGTK3__ + CHECK(isChild1Painted == false); CHECK(isParentPainted == true); - CHECK(isChild1Painted == false); CHECK(isChild2Painted == true); CHECK(isChild3Painted == true); }