JDK-4628020 : Packed frames are sized incorectly if disposed and re-shown.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_7
  • CPU: generic,sparc
  • Submitted: 2002-01-24
  • Updated: 2002-10-22
  • Resolved: 2002-10-09
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.
Other
1.4.0_03 03Fixed
Related Reports
Duplicate :  
Relates :  
Description

Name: vuR10080			Date: 01/24/2002



As reported in 4615863 (problem3), subwindow size become smaller by
clicking "open window" button and "alt-F4".

What really happens is that a packed frame is being disposed and then
shown again and the code to calculate insets under X11 resizes the
frame incorrectly.

Filing this as a separate bug report for easier tracking.

###@###.###  2002-01-24

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.0_03 1.4.1_02 mantis FIXED IN: 1.4.0_03 1.4.1_02 mantis INTEGRATED IN: 1.4.0_03 1.4.1_02 mantis mantis-b06
2004-06-14

SUGGESTED FIX The fix invloves changes in two files: src/share/classes/java/awt/Component.java src/share/classes/java/awt/Window.java ------- Component.java ------- *** /tmp/dLZaWay Sat Aug 31 00:00:11 2002 --- Component.java Fri Aug 30 01:48:32 2002 *************** *** 1127,1133 **** if (b) { show(); } else { ! hide(); } } --- 1127,1134 ---- if (b) { show(); } else { ! isPacked = false; ! hide(); } } ------- Window.java ------- *** /tmp/d8PaW_x Fri Aug 30 23:57:31 2002 --- Window.java Fri Aug 30 23:31:31 2002 *************** *** 106,112 **** static boolean systemSyncLWRequests = false; boolean syncLWRequests = false; ! static final int OPENED = 0x01; /** --- 106,113 ---- static boolean systemSyncLWRequests = false; boolean syncLWRequests = false; ! boolean isFirstPack = true; ! static final int OPENED = 0x01; /** *************** *** 428,434 **** addNotify(); } setSize(getPreferredSize()); ! isPacked = true; validate(); } --- 429,439 ---- addNotify(); } setSize(getPreferredSize()); ! ! if(isFirstPack == true) { ! isPacked = true; ! isFirstPack = false; ! } validate(); } ###@###.### 2002-09-02
2002-09-02

EVALUATION Name: vuR10080 Date: 01/24/2002 When we do the infamous resize dance after correct insets are computed, we check if the requested top-level size was set via pack(). If it was, then we take the interior size as the constraint and assume that it was computed with incorrect insets. So we resize the top-level to adjust for corrected insets and to keep the interior size. The way it was done is very simple-minded - we just set a flag in pack and check that flag when we realize the peer. The top-level is then resized but the flag is not cleared. So when he top-level is disposed and realized again, the code thinks that the size of the top-level (corrected upon first show()) was computed using incorrect insets and re-resizes the top-level &c. So on each show() the top-level size is repeatedly adjusted by the difference between the insets guess (usually wrong) and actual insets. ###@###.### 2002-01-24 ======================================================================
2002-01-24