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
https://github.com/wxWidgets/wxWidgets/pull/26903
(3 files)
—
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.![]()
@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.![]()
@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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
@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.![]()
> // ----------------------------------------------------------------------------
// 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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
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.![]()
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.![]()
@LegalizeAdulthood pushed 1 commit.
—
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.![]()
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.![]()
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.![]()
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.![]()