Resize AUI MDI client with parent frame (PR #26903)

59 views
Skip to first unread message

Richard Thomson

unread,
Aug 24, 2026, 4:01:25 PMAug 24
to wx-...@googlegroups.com, Subscribed

Handle parent size events in wxAuiMDIParentFrame and resize the AUI MDI client window to the current frame client area. Also size the client window immediately after creation so child pages start from the frame's actual client size.

Add a regression test covering an AUI MDI child with expanding content while the parent frame is resized.

Fixes #9442


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26903

Commit Summary

  • e83f7ad Resize AUI MDI client with parent frame

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903@github.com>

AliKet

unread,
Aug 25, 2026, 7:43:19 AMAug 25
to wx-...@googlegroups.com, Subscribed

@AliKet commented on this pull request.


In tests/controls/auitest.cpp:

> @@ -50,10 +52,61 @@ class AuiNotebookTestCase
     wxAuiNotebook* const nb;
 };
 
+#if wxUSE_MDI
+
+class AuiMDITestCase
+{
+public:
+    AuiMDITestCase()
+        : frame(new wxAuiMDIParentFrame(nullptr, wxID_ANY,
+              "wxAuiMDIParentFrame test"))
+    {
+    }

The frame is hidden under wxQt (didn't test under the other platforms) and adding frame->Show(); makes the test pass for me.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/review/5018460585@github.com>

VZ

unread,
Aug 26, 2026, 8:41:24 AMAug 26
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

I'm a bit surprised that this is needed because m_pClientWindow seems to be the only child of wxAuiMDIParentFrame and so should be already resized to its entire client area automatically, do you understand why this doesn't happen?

But we can merge this, once the tests pass (which should be simple if showing the frame is all that's needed).

Thanks!


In tests/controls/auitest.cpp:

>  // ----------------------------------------------------------------------------
 // the tests themselves
 // ----------------------------------------------------------------------------
 
+#if wxUSE_MDI
+
+TEST_CASE_METHOD(AuiMDITestCase,
+                 "wxAuiMDIParentFrame::ChildWindowResize", "[aui][mdi]")
+{
+    wxAuiMDIClientWindow* const client = frame->GetClientWindow();
+    REQUIRE( client );
+
+    wxAuiMDIChildFrame* const child =

Why not use unique_ptr for this one too? I think we can delete it just fine, as it's a child window.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/review/5030445176@github.com>

Richard Thomson

unread,
Aug 27, 2026, 4:36:04 PMAug 27
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • 1d37b60 Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/e83f7ad7746d686a98dc56d7e1eff742de0288ed/after/1d37b6026729f8663771af5d848bbd347068bf6e@github.com>

Richard Thomson

unread,
Sep 3, 2026, 2:50:59 PMSep 3
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • 4489de4 Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/1d37b6026729f8663771af5d848bbd347068bf6e/after/4489de4f46430f267e24190b83cfeb7d13d5c311@github.com>

Richard Thomson

unread,
Sep 3, 2026, 2:51:06 PMSep 3
to wx-...@googlegroups.com, Subscribed

@LegalizeAdulthood commented on this pull request.


In tests/controls/auitest.cpp:

> @@ -50,10 +52,61 @@ class AuiNotebookTestCase
     wxAuiNotebook* const nb;
 };
 
+#if wxUSE_MDI
+
+class AuiMDITestCase
+{
+public:
+    AuiMDITestCase()
+        : frame(new wxAuiMDIParentFrame(nullptr, wxID_ANY,
+              "wxAuiMDIParentFrame test"))
+    {
+    }

fixed


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/review/5105625208@github.com>

Richard Thomson

unread,
Sep 3, 2026, 3:05:56 PMSep 3
to wx-...@googlegroups.com, Subscribed

@LegalizeAdulthood commented on this pull request.


In tests/controls/auitest.cpp:

>  // ----------------------------------------------------------------------------
 // the tests themselves
 // ----------------------------------------------------------------------------
 
+#if wxUSE_MDI
+
+TEST_CASE_METHOD(AuiMDITestCase,
+                 "wxAuiMDIParentFrame::ChildWindowResize", "[aui][mdi]")
+{
+    wxAuiMDIClientWindow* const client = frame->GetClientWindow();
+    REQUIRE( client );
+
+    wxAuiMDIChildFrame* const child =

done


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/review/5105758189@github.com>

Richard Thomson

unread,
Sep 3, 2026, 3:06:06 PMSep 3
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • 33d5b1d Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/4489de4f46430f267e24190b83cfeb7d13d5c311/after/33d5b1d0a819f2c43d8668d88045dfac7342089d@github.com>

Richard Thomson

unread,
Sep 18, 2026, 8:26:36 PM (5 days ago) Sep 18
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • bfccb31 Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/33d5b1d0a819f2c43d8668d88045dfac7342089d/after/bfccb316ee618e38a1ae920a1a287a9b5a73a86c@github.com>

Richard Thomson

unread,
Sep 18, 2026, 8:51:53 PM (4 days ago) Sep 18
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • a4be7d2 Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/bfccb316ee618e38a1ae920a1a287a9b5a73a86c/after/a4be7d274a93d40f1e249dc0e2181aa415ce1ede@github.com>

Richard Thomson

unread,
Sep 18, 2026, 9:31:12 PM (4 days ago) Sep 18
to wx-...@googlegroups.com, Subscribed
LegalizeAdulthood left a comment (wxWidgets/wxWidgets#26903)

The failing tests are in source files not touched by this PR. There is some question about whether or not the new tests are messing up shared GUI state that is causing the failures. What do you think, @vadz ?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/c5738270581@github.com>

Richard Thomson

unread,
Sep 19, 2026, 4:47:44 PM (4 days ago) Sep 19
to wx-...@googlegroups.com, Subscribed
LegalizeAdulthood left a comment (wxWidgets/wxWidgets#26903)

Since the tests aren't failing elsewhere I think what's happening here is that assumed GUI state isn't being preserved across test cases here because this new test case creates a new top-level window and changes focus. I'm working on a setup/teardown change to account for this and restore the active window and focus in effect when the test starts.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/c5745185501@github.com>

Richard Thomson

unread,
Sep 19, 2026, 4:56:12 PM (4 days ago) Sep 19
to wx-...@googlegroups.com, Push

@LegalizeAdulthood pushed 1 commit.

  • 5f6c572 Resize AUI MDI client with parent frame


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/before/a4be7d274a93d40f1e249dc0e2181aa415ce1ede/after/5f6c572fa90306777f3d82a3e42ca267c82fa3f6@github.com>

VZ

unread,
Sep 20, 2026, 12:41:01 PM (3 days ago) Sep 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26903)

Thanks, the tests pass now, but I'd still like to have the answer to my question above: do you understand why do we need to explicitly do something that should happen by default?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/c5751150498@github.com>

Richard Thomson

unread,
Sep 21, 2026, 10:01:31 AM (2 days ago) Sep 21
to wx-...@googlegroups.com, Subscribed
LegalizeAdulthood left a comment (wxWidgets/wxWidgets#26903)

Thanks, yes, I think I understand what's going on now.

wxAuiMDIParentFrame creates its client window after wxFrame::Create() has already run. The generic top-level fallback that resizes a single child to fill the client area only helps when Layout() sees exactly one shown non-bar child. At frame creation time, the AUI MDI client doesn't exist yet, and later it is just a normal wxAuiNotebook child created with its initial size, not managed by a sizer.

So the explicit SetSize(GetClientSize()) is compensating for that missed layout path and making the AUI MDI client behave like a real MDI client area: it always tracks the parent frame's client size, which then lets the child pages resize with the frame.

The fix is compensating for an assumption that turned out to be too weak: “it is the only child, so the frame will size it for us.” That should often work, but it is indirect and timing/visibility/layout dependent. Making wxAuiMDIParentFrame explicitly keep m_pClientWindow sized to GetClientSize() is localizing the responsibility where it belongs.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/c5761714406@github.com>

VZ

unread,
Sep 21, 2026, 10:06:23 AM (2 days ago) Sep 21
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26903)

Hmm, should we fix this by checking if the first child is added in AddChild() and resizing it to fit the entire window? Maybe not immediately, but using CallAfter() and only doing it if it's still the only child by the time it runs?

I think it's really unexpected that the only child is not resized to fill the window automatically.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26903/c5761768297@github.com>

Reply all
Reply to author
Forward
0 new messages