Repository navigation
Heavyweight: re-position the native WebView when an ancestor moves or resizes - #74
Merged
Merged
Conversation
… resizes (Canvas 6 Fix 3) sizeNative() positions the native view in window-content coordinates but ran only on the canvas's own componentMoved/componentResized. Dragging an ancestor (a JInternalFrame across a JDesktopPane) moves the canvas in the window without moving it within its parent, so no event fired and on macOS the WKWebView stayed behind. EmbeddedCanvas now also listens for ancestorMoved and ancestorResized and re-sizes the native view while showing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012AhsKesqVAYvmUoDMkPLRt
shannah
marked this pull request as ready for review
October 21, 2026 13:28
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.
Problem
On macOS the heavyweight
WKWebViewis a subview ofNSWindow.contentView, positioned in window coordinates bysizeNative().sizeNative()ran only on the canvas's owncomponentMovedandcomponentResized(plus on show and on attach).When an ancestor moves, the canvas's position within its parent doesn't change, so AWT fires neither event and the native view stays where it was. This happens when you drag a
JInternalFramethat holds the web view across aJDesktopPane, or move a container with a split-pane divider without resizing it. It was reported from the Agentic App Framework's desktop view: "When I move a window, the webview isn't moved". Resizing the window or switching tabs fixed it.Fix (Canvas 6, Fix 3)
EmbeddedCanvasnow also installs aHierarchyBoundsListener. ItsancestorMovedandancestorResizedcallsizeNative()while the canvas is showing.There is no native change.
sizeNative()already sends window-content coordinates on every platform, so calling it from here is correct on all of them. It is idempotent with the existing triggers.Testing
javacoversrc/).JInternalFrameholding aWebViewComponentand the page should follow the frame.The app works around this today by firing
COMPONENT_MOVEDat the canvases when a desktop window moves. Once this is released, the framework can drop that workaround.Generated by Claude Code