Translucent/Shaped Windows

Doug Zwick Doug.Zwick at blackboard.com
Tue Jul 17 14:53:22 PDT 2012


> What is the current status of the Translucent/Shaped Windows API in the OS X port? I am updating some code using the old Java 1.6 temporary API to use the final 1.7 API, and the window is not passing mouse clicks through properly (the Apple 1.6 JRE did pass clicks through). I am running with 1.7.0_05. I did notice that calls to Window.setShape throw an exception:
>
> java.lang.UnsupportedOperationException: PERPIXEL_TRANSPARENT translucency is not supported.
>
> However, GraphicsDevice.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT) returned true. The Apple J2SE 6 implementation did much the same thing. I believe Apple's JVM passed clicks through based on the painted alpha, rather than using the window shape, and that the Java 1.7.0_05 likely does not do this. Another difference is that the J2SE 7 API dropped the AWTUtilities.setWindowOpaque(boolean) method, and handles this automatically when the Window instance setBackground method is invoked with a non-opaque colour. I have set the background of the Window to new Color(0, 0, 0, 0), so I don't believe that this is the issue.

I can confirm that the code works correctly (the shaped window passes clicks through as expected) on Windows under Java 1.7.0_05. The problem still exists in the current Mac EA for update 6 (1.7.0_06-ea-b19). Should I enter a bug report? Is bugs.sun.com still the right place, or is there an Oracle or OpenJDK bug database these days? I think there are two bugs here -- that the transparent window does not pass clicks, and that Window.setShape throws when isWindowTranslucencySupported says it should work. Do you have a preference on how I enter them?

This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.


More information about the macosx-port-dev mailing list