mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-24 07:24:31 +08:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user