Conversation
Filter bubbled wxEVT_DESTROY events by their source window before invalidating AUI managers, dispatching WindowEvents::on_destroy callbacks, or releasing Rust event closures. This prevents AUI floating-pane re-docking from invalidating the managed frame and dropping its callbacks.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens wxEVT_DESTROY handling so that bubbled destroy events from child windows (notably wxAUI floating panes during re-docking) don’t invalidate unrelated AUI managers, fire WindowEvents::on_destroy callbacks on the wrong window, or prematurely release Rust event closures.
Changes:
- Filter
wxEVT_DESTROYinAuiManagerBuilderso the manager invalidates only when its managed window is the destroy event source. - Switch
WindowEventsto a new macro that ignores destroy events whoseevent_objectisn’t the target window. - In the C++ event dispatcher, only release bound Rust closures on
wxEVT_DESTROYwhen the handler’s owning window is the event source.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rust/wxdragon/src/widgets/aui_manager.rs | Filters destroy invalidation to the managed window only. |
| rust/wxdragon/src/event/window_events.rs | Uses a new window-aware event handler macro for destroy filtering. |
| rust/wxdragon/src/event/macros.rs | Adds macro that suppresses bubbled destroy events from child windows. |
| rust/wxdragon-sys/cpp/src/event.cpp | Prevents destroy events from other windows from releasing this handler’s closures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filter bubbled wxEVT_DESTROY events by their source window before invalidating AUI managers, dispatching WindowEvents::on_destroy callbacks, or releasing Rust event closures. This prevents AUI floating-pane re-docking from invalidating the managed frame and dropping its callbacks.