-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix wxAuiManager interfering with docview event propagation #25336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The failed check says that awk is missing from the build system. I'm pretty sure that is unrelated to this change. |
Yes, see #25337. |
vadz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but while I have just a minor comment about the first commit, I don't think the second one is correct.
|
BTW, I don't know if I should apply the first commit (with its fixup) already? |
I would be inclined to wait until we get the iteration cleanup fixed as well, since I'm pretty sure applying the Unbind() part of the first commit will cause more cases of iteration problems. |
vadz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me now!
Ideal would be to add a test (to tests/events/propagation.cpp or some other file in this directory) verifying that this now works correctly, but I am not sure if there is a relatively simple way to do it. If you can think of anything, please consider adding it because this code is clearly rather fragile and having a test checking that this doesn't get broken again would be very useful.
TIA!
It looks to me like I can create a |
|
I have successfully created a However, there are two questions I have about this test:
|
|
FYI, the |
Great, thanks!
I am not sure if sharing the code is not going to make things more/too complicated. If I'm wrong, and the merged test remains relatively simple, then, sure, let's merge them. But I'm much less allergic to code duplication in the tests than in the main library, so I'm also fine with leaving this as is.
I don't think this is necessary but you can still rebase this branch on master, if only to squash the fixup commits and fix the CircleCI build (which was fixed on master since this PR was opened). Thanks! |
I have rebased on master, and also added a new commit b303e22 that merges the tests. I will leave it to you to decide whether this is "relatively simple". If it is not, then feel free to drop that commit. |
881fa62 to
e774291
Compare
|
Please apply this patch: diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp
index 7f670a6045..6f5ae97d71 100644
--- a/src/qt/frame.cpp
+++ b/src/qt/frame.cpp
@@ -226,7 +227,10 @@ void wxFrame::RemoveChild( wxWindowBase *child )
// excluding any menubar and toolbar if any.
wxPoint wxFrame::GetClientAreaOrigin() const
{
- return wxQtConvertPoint( GetQMainWindow()->centralWidget()->pos() );
+ if ( GetQMainWindow() )
+ return wxQtConvertPoint( GetQMainWindow()->centralWidget()->pos() );
+
+ return wxPoint();
}
QMainWindow *wxFrame::GetQMainWindow() const
which should fix the crash and should have been part of #25332 Edit: |
|
See c07c636 |
It looks like the patch fixes the problem on Ubuntu, but not Windows. Edit: |
#25368 should fix the crashes seen here. BTW 495caaf is not needed. |
and also whether Unbind() causes array bound errors
Implement recommendation in wxWidgets#25219 (comment) Fix wxWidgets#25219
SearchDynamicEventTable() tries to handle an event handler that calls Unbind(), but previously failed to account for SearchDynamicEventTable() being recursive when an event handler processes a new event. Use wxSharedPtr<> to ensure life of wxRecursionGuardFlag extends beyond wxRecursionGuard. This enables all recursive call to SearchDynamicEventTable() to prune empty elements from m_dynamicEvents, not just outermost recursive call. more detailed explanation of need for wxSharedPtr<> Co-authored-by: VZ <[email protected]>
b3d10ef to
c8ef488
Compare
wxEvtHandler in master doesn't need to be ABI-compatible with 3.2, so don't bother checking that it is and remove the static asserts added in c8ef488 (SearchDynamicEventTable(): handle recursion, 2025-04-16) See wxWidgets#25336.
No description provided.