United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4628020 : Packed frames are sized incorectly if disposed and re-shown.

Details
Type:
Bug
Submit Date:
2002-01-24
Status:
Resolved
Updated Date:
2002-10-22
Project Name:
JDK
Resolved Date:
2002-10-09
Component:
client-libs
OS:
solaris_7,generic
Sub-Component:
java.awt
CPU:
sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.0_03 (03)

Related Reports
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

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
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
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
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



Hardware and Software, Engineered to Work Together