JDK-6176875 : XAWT: disabling lightweight container disabled heavyweight children
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-10-11
  • Updated: 2011-01-19
  • Resolved: 2005-04-18
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
6 b33Fixed
Related Reports
Relates :  
Description
Run the attached test case on Windows/Motif/XAWT. It produces output - disability matrix, I present it here:

Legend: PLW - "parent lightweight?", PEN - "parent enabled", CEN -
"child enabled"

XAWT:
PLW     PEN     CEN     Mouse   Key
hw      en      en      t       t
hw      en      dis     f       f
hw      dis     en      f       f
hw      dis     dis     f       f
lw      en      en      t       t
lw      en      dis     f       f
lw      dis     en      f       f
lw      dis     dis     f       f

Motif:
PLW     PEN     CEN     Mouse   Key
hw      en      en      t       t
hw      en      dis     f       f
hw      dis     en      f       f
hw      dis     dis     f       f
lw      en      en      t       t
lw      en      dis     f       f
lw      dis     en      t       t
lw      dis     dis     f       f

Windows:
PLW     PEN     CEN     Mouse   Key
hw      en      en      t       t
hw      en      dis     f       f
hw      dis     en      f       f
hw      dis     dis     f       f
lw      en      en      t       t
lw      en      dis     f       f
lw      dis     en      t       t
lw      dis     dis     f       f

Notice the difference between XAWT and Motif/Windows behavior - it shows that on XAWT disabling lightweight container makes heavyweight children also disabled. This is a backward-incompatible change.
###@###.### 10/11/04 12:23 GMT

Comments
SUGGESTED FIX #sccs diffs -C XComponentPeer.java ------- XComponentPeer.java ------- *** /tmp/sccs.VB2a5c 2005-03-23 16:53:37.352781112 +0300 --- XComponentPeer.java 2005-03-11 19:32:31.000000000 +0300 *************** *** 136,146 **** enabled = target.isEnabled(); ! // If any of our ancestors are disabled, we should be too Component comp = target; while( !(comp == null || comp instanceof Window) ) { comp = comp.getParent(); ! if( comp != null && !comp.isEnabled() ) { setEnabled(false); break; } --- 136,147 ---- enabled = target.isEnabled(); ! // If any of our heavyweight ancestors are disable, we should be too ! // See 6176875 for more information Component comp = target; while( !(comp == null || comp instanceof Window) ) { comp = comp.getParent(); ! if( comp != null && !comp.isEnabled() && !comp.isLightweight() ){ setEnabled(false); break; } ###@###.### 2005-03-23 14:15:55 GMT
23-03-2005

EVALUATION In XToolkit we add disabling component if ancestors are disabled (postInit method). It would be a good idea disabling component only for heavyweight parent. This is a backward-incompatible change. ###@###.### 2005-03-18 17:28:30 GMT
18-03-2005