From 0e96f1dfa0bbec6eb62ee2ed3e3fd4b01fbe3568 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 27 Aug 2026 10:00:53 -0400 Subject: [PATCH] Add dummy sibling window in TextCtrlTestCase to avoid GTK lone-child sizing Same issue as ClippingBoxTestCase::wxPaintDC: a sole child window gets stretched to fill the parent under wxGTK, breaking HitTest() and the multiline PositionToCoords* tests via a wrongly inflated allocation. --- tests/controls/textctrltest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 4fe879ff42..68e0a640fe 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -118,6 +118,8 @@ protected: std::unique_ptr m_text; + std::unique_ptr m_dummySibling; + const long m_style; wxDECLARE_NO_COPY_CLASS(TextCtrlTestCase); @@ -197,6 +199,7 @@ void TextCtrlTestCase::CreateText(long extraStyles) { const long style = m_style | extraStyles; const int h = (style & wxTE_MULTILINE) ? TEXT_HEIGHT : -1; + m_dummySibling = make_unique(wxTheApp->GetTopWindow(), wxID_ANY); m_text = make_unique(wxTheApp->GetTopWindow(), wxID_ANY, "", wxDefaultPosition, wxSize(400, h), style);