United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6788954 Need to introduce sun.awt.disableMixing system property
JDK-6788954 : Need to introduce sun.awt.disableMixing system property

Details
Type:
Enhancement
Submit Date:
2008-12-24
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2009-05-15
Component:
client-libs
OS:
generic
Sub-Component:
java.awt
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u14
Fixed Versions:
6u14 (b01)

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

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
EVALUATION

The Component.isMixingNeeded() should return false if the system property is set to true.
                                     
2008-12-24
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
                                     
2008-12-25



Hardware and Software, Engineered to Work Together