JDK-6533330 : regresssion: ancestorResized event is not triggering, when resizing the frame.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-12
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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 7
7 b14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
when ever the ancestor is moved or resized, HierarchyBoundsListener Hierarchy event will be triggered. I have a frame which contains some awt components added to it. I have added HierarchyBoundsListener to all the components. When i move the frame ancestorMoved event is triggered , but when i resize the frame  ancestorResized event is not triggering. This happens from jdk7.0 b09 onwards. It works fine in jdk7.0 b07. I dn't have jdk7.0 b08 build.

Step to reproduce:
------------------
1) Run the attached program.
2) Observe on console that ANCESTOR_RESIZED event is triggered once. but ANCESTOR_MOVED event is triggered  no of times.
3) Move the frame. Observe that ANCESTOR_MOVED event is triggered.
4) Resize the frame. Observe that ANCESTOR_RESIZED event is not triggered. If you see the same then the bug is reproduced.

Comments
SUGGESTED FIX $ sccs diffs -C awt_Window.cpp ------- awt_Window.cpp ------- *** /tmp/sccs.5Cvckt 2007-03-15 14:25:29.000000000 +0300 --- awt_Window.cpp 2007-03-15 14:23:35.000000000 +0300 *************** *** 1130,1135 **** --- 1130,1142 ---- (env)->SetIntField(target, AwtComponent::heightID, newHeight); if (!AwtWindow::IsResizing()) { WindowResized(); + } else { + if (AwtToolkit::GetInstance().IsDynamicLayoutActive()) { + // The actual relayouting happens at the AwtComponent::WmSizing(), + // though the later one is being invoked a bit more often than the WmSize() + SendComponentEvent(java_awt_event_ComponentEvent_COMPONENT_RESIZED); + } + } env->DeleteLocalRef(target);
15-03-2007

EVALUATION The COMPONENT_RESIZED event is sent at the WindowResized() function at the awt_Window.cpp file. However, with the fix of 6500477, the invocation of the WindowResized() function (at WmSize()) was guarded stricter because the m_resizing flag was set to true more often. And hence, the COMPONENT_RESIZED event was not sent while resizing.
15-03-2007

EVALUATION This is a regression caused by the fix for 6500477. I have changed the check ((wParam & 0xFFF0) == SC_SIZE) back to (wParam == SC_SIZE) and this bug has disappeared. It seems we need to fix 6500477 more carefully.
13-03-2007