Skip to content
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

WebDockableFrame doesn't show AWT components #528

Closed
husker-dev opened this issue Sep 3, 2019 · 5 comments
Closed

WebDockableFrame doesn't show AWT components #528

husker-dev opened this issue Sep 3, 2019 · 5 comments
Assignees

Comments

@husker-dev
Copy link

husker-dev commented Sep 3, 2019

WebDockableFrame doesn't show AWT elements like Label and GLCanvas (from JOGL)

@husker-dev husker-dev changed the title WebDockableFrame don't show AWT components WebDockableFrame doesn't show AWT components Sep 3, 2019
@mgarin mgarin self-assigned this Sep 3, 2019
@mgarin mgarin added the bug label Sep 3, 2019
@mgarin mgarin added this to the v1.2.10 milestone Sep 3, 2019
@mgarin
Copy link
Owner

mgarin commented Sep 3, 2019

I'll test this tomorrow, but for now -
Was there anything special with the placement of AWT elements within WebDockableFrame?
Or you simply put it straight as the content?

@husker-dev
Copy link
Author

I put a webpanel as content in which there were awt components.

@mgarin
Copy link
Owner

mgarin commented Sep 4, 2019

Thanks, i'll try it.

@mgarin
Copy link
Owner

mgarin commented Sep 4, 2019

I found the problem and it seem to be consistent with all AWT components - they cannot be displayed under any other Swing component, transparent or not. Which in case of the WebDockablePane is a transparent glass pane (DockablePaneGlassLayer) added within WebDockablePane to track mouse location and support resize operations for the frames.

I usually do not have any hidden glass layers on components, but in case of WebDockablePane it is necessary to consistently support resize operation, even on top other components within frames and content area that might be catching mouse events.

Unfortunately I haven't found any possible solution for that issue with AWT components, will see if I can find anything on it on the net.

mgarin added a commit that referenced this issue Sep 4, 2019
- ProprietaryUtils.java - Added `enableMixingCutoutShape(Component)` method to workaround shape mixing for opaque/heavyweight components
- DockablePaneGlassLayer.java - Now properly uses shape cutout mode to avoid issues wih opaque/heavyweight components
@mgarin
Copy link
Owner

mgarin commented Sep 4, 2019

Well, I managed to find a wild workaround that Swing uses for its own glass pane. It's not really a public API so I've added new method to ProprietaryUtils - enableMixingCutoutShape ( Component ). It allows mixing lightweight and heavyweight components on the same layer. There will still be some visual glitches if anything is drawn on top of an AWT component, but it will properly display within WebDockablePane now and generally should work as expected.

I can't really do much about Swing components intersecting with AWT ones (for instance a tooltip or a menu) - they will still hide parts of AWT components while positioned on top of them, but AWT components will not be permanently hidden anymore.

New v1.2.10 snapshot build will soon be available with the added changes and the final v1.2.10 update will most probably be available this Friday or Saturday.

@mgarin mgarin closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants