<AWT Dev> Embedding native widgets into AWT Canvas on Mac - NSView / CALayer pb in JDK1.7

Mike Swingler swingler at apple.com
Fri Dec 20 16:19:58 PST 2013


On Dec 20, 2013, at 6:41 AM, Christophe Cornu <christophe.cornu at gmail.com> wrote:

> Hello:
> 
> Since JDK1.7, Canvas is no longer backed up by an NSView. This broke a few projects, e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=418245. It's no longer possible to embed inside AWT things like SWT widgets, Apple WebView component (which extends NSView).
> 
> What do the AWT committers think going forward? Will it be possible to have an internal Canvas class that would be backed up by NSView, to be used by embedders? Or should we give up the idea of plugging in native widgets into AWT through NSView and treat CALayer as the way forward?

The crux of the problem has to do with the applet embedding case, where the underlying primitive provided by the browser is a CALayer, and there is no underlying NSView, and all events are synthetic and re-dispatched through the NPAPI. This enables the sandboxing and cross process rendering that applets require. The entirety of the Java 2D graphics stack in Java 7 now renders using pure OpenGL onto a single canvas, and there is no (significant) NSView or CALayer hierarchy.

To re-introduce an NSView hierarchy, you'd have to split the OpenGL rendering layers between the components that should be atop each JAWT NSView and the components that should be below. The task is not without complexity, but the payoff would be quite significant with respect to event dispatch, and re-enabling all the old embedding designs.

If you'd like to take this on, I'm sure many people would appreciate it, but I want you to be aware of the full complexity of the task. There certainly have been no volunteers thus far.

Regards,
Mike Swingler
Apple Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20131220/0f2f2962/attachment.html 


More information about the awt-dev mailing list