JDK-4942457 : XToolkit: calling toFront() on Frame generates unexpected COMPONENT_RESIZED even
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2003-10-23
  • Updated: 2003-11-26
  • Resolved: 2003-11-26
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
5.0 b30Fixed
Related Reports
Relates :  
Relates :  
Description

Name: atR10251			Date: 10/23/2003


Unexpected COMPONENT_RESIZED event is generated when toFront() is
called.
This occures on XAWT only.
Run the test below to reproduce the problem.

=============== TEST CASE ==================
import java.awt.*;
import java.awt.event.*;

public class ToFrontTest {

    public static void main(String[] args)
      throws Exception
    {
        final Frame f1 = new Frame("F-0"), f2 = new Frame("F-1");
        f1.setSize(200, 100);
        f2.setSize(200, 100);
        f2.setLocation(f1.getX() + 210, f1.getY());
        f1.setVisible(true);
        f2.setVisible(true);

        Thread.sleep(1000);

        Toolkit.getDefaultToolkit().addAWTEventListener(new
AWTEventListener() {
                public void eventDispatched(AWTEvent e) {
                    if (e.getSource() == f1) {
                        System.err.println(e);
                    }
                }
            }, ComponentEvent.COMPONENT_EVENT_MASK);

        f1.toFront();
    }
}
=================  END  ====================
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b30 tiger-beta
24-08-2004

SUGGESTED FIX Name: dmR10075 Date: 10/23/2003 *** /tmp/geta16507 2003-10-23 15:56:23.000000000 +0400 --- XContentWindow.java 2003-10-23 15:12:03.000000000 +0400 *************** *** 62,69 **** newBounds.setLocation(-in.left, -in.top); } if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting content bounds " + newBounds); reshape(newBounds); ! handleResize(newBounds); } finally { XToolkit.awtUnlock(); } --- 62,72 ---- newBounds.setLocation(-in.left, -in.top); } if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting content bounds " + newBounds); + boolean needHandleResize = !(newBounds.getSize().equals(getSize())); reshape(newBounds); ! if (needHandleResize) { ! handleResize(newBounds); ! } } finally { XToolkit.awtUnlock(); } ###@###.### 2003-10-23 ======================================================================
23-10-2003

EVALUATION Name: dmR10075 Date: 10/23/2003 This happens because X server generates ConfigureNotify for stacking order change and we don't filter it off, generating Java event. ###@###.### 2003-10-23 ======================================================================
23-10-2003