JDK-6788954 : Need to introduce sun.awt.disableMixing system property
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-12-24
  • Updated: 2011-01-19
  • Resolved: 2009-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u14 b01Fixed 7Resolved
Related Reports
Relates :  
Relates :  
Description
By means of 6776743 all lightweight components are considered opaque by the HW/LW mixing code. If a component needs to be transparent, it must be specifically marked so using the newly introduced com.sun.awt.AWTUtilities.setComponentNonOpaqueForMixing() method.

If an existing application embedds a heavyweight component in a frame, and at the same time installs a custom glass pane, the heavyweight component will disappear. This regression is not very serious since we never supported mixing of hw and lw components in general. The developer will have two options to resolve the problem:

1. By modifying the software to tag the glass pane properly, or

2. To suggest users to use the sun.awt.disableMixing system property to disable the hw/lw mixing code at all.

Comments
SUGGESTED FIX --- old/src/share/classes/java/awt/Component.java 2008-12-25 13:56:28.000000000 +0300 +++ new/src/share/classes/java/awt/Component.java 2008-12-25 13:56:28.000000000 +0300 @@ -9884,6 +9884,12 @@ } final boolean isMixingNeeded() { + if (SunToolkit.getSunAwtDisableMixing()) { + if (mixingLog.isLoggable(Level.FINEST)) { + mixingLog.finest("this = " + this + "; Mixing disabled via sun.awt.disableMixing"); + } + return false; + } if (!areBoundsValid()) { if (mixingLog.isLoggable(Level.FINE)) { mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid()); --- old/src/share/classes/sun/awt/SunToolkit.java 2008-12-25 13:56:29.000000000 +0300 +++ new/src/share/classes/sun/awt/SunToolkit.java 2008-12-25 13:56:29.000000000 +0300 @@ -1959,6 +1959,21 @@ return AccessController.doPrivileged(new GetBooleanAction("sun.awt.untrustedTopLevelTranslucency")); } + private static Boolean sunAwtDisableMixing = null; + + /** + * Returns the value of "sun.awt.disableMixing" property. Default + * value is {@code false}. + */ + public synchronized static boolean getSunAwtDisableMixing() { + if (sunAwtDisableMixing == null) { + sunAwtDisableMixing = Boolean.valueOf( + AccessController.doPrivileged( + new GetBooleanAction("sun.awt.disableMixing"))); + } + return sunAwtDisableMixing.booleanValue(); + } + /** * Returns whether or not a containing top level window for the passed * component is
25-12-2008

EVALUATION The Component.isMixingNeeded() should return false if the system property is set to true.
24-12-2008