Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4111098

Regression: two windows stuck in loop, brought to the front over the other

XMLWordPrintable

    • 1.1.6
    • sparc
    • solaris_2.5.1
    • Verified

        This bug is from Oracle, a Java licensee.

         
        There is a serious regression bug where 2 windows
        get stuck in an infinite loop, alternately
        brought to the front over each other.
        The bug first appeared in or before JDK 1.1.6E.
        The bug did not exist in 1.1.6B, but
        we cannot verify if the bug first appeared in
        1.1.6C or D, because 1.1.6C was never released to
        licensees, and 1.1.6D has a hanging VM bug so we
        cannot test with it.
        The bug has not been fixed as of 1.1.6F.
         
        We have a simple Oracle Webforms applet, where
        clicking on a checkbox in one window opens
        a new window. Before 1.1.6E, the new window would
        come up over the old window, and there were
        no problems. With 1.1.6E onwards, when the new
        window is displayed, right away the 2 windows
        start switching back and forth, being alternately
        activated and brought to front. This goes on
        indefinitely. With the Webforms testing setup
        available at JavaSoft through Marianne Mueller,
        you just need to launch an Oracle Applications
        Webforms applet, and when 2 windows (the toolbar
        and the app window) are displayed, they will
        enter this infinite loop.
         
        The problem seems to be in a bug fix made
        around the timeframe of 1.1.6C/D, for JavaSoft
        bug 4085080 / Oracle bug 560041.
        From the Putback Comments from Jan 5, 1998 @
        14.7.7 in the JDK 1.1.6x history file:
         
        Bug ID: 4085080
             Synopsis: WINDOW.GETFOCUSOWNER DOESN'T RETURN NULL IF THE
             WINDOW IS INACTIVE
             Comments: Process activate and deactivate
             events in Window to determine if window is active.
         
        The fix was in the getFocusOwner() and
        dispatchEventImpl() methods in
        src\share\java\java\awt\Window.java, and the use
        of a private variable to keep track of the
        active/inactive state of a Window seems to lead
        to this bug. We are looking into this code.
         
        We do not currently have a simple Java test case
        for the problem, but we are working on one and
        will supply it to Marianne Mueller @ JavaSoft,
        who can add it to this bug record. We will
        also work on providing more info and suggesting
        a fix.

         
        James Jung-Hoon Seo // Oracle Tools Fundamental Technologies Group
            (650) 506-3829 // ###@###.###
         
         
         -----

        This problem can be reproduced from a networked PC inside JavaSoft using

          % appletviewer http://perper.eng/html/tifncan1.html

        The NT machine, perper, is running the Oracle server applications.

        This problem shows up on win32 only.


        ------

        marianne.mueller@Eng 1998-02-18

        Here's a Java test case from James Seo at Oracle.

        --------b4111098.java----------

        import java.applet.*;
        import java.awt.*;
        import java.awt.event.*;

        //public class b623445 extends Applet
        public class b4111098 extends Applet
        {
        public void start()
            {
        MyFrame mf1 = new MyFrame();
        mf1.setBounds(100,100,300,300);
        mf1.setVisible(true);
        mf1.mc1.requestFocus();
        }
        }

        class MyFrame extends Frame implements ActionListener, WindowListener
        {
        public Button mb = null;
        public MyComponent mc1 = null; // the "real" focus owner
        public MyComponent mc2 = null; // the temporary focus owner

        public MyFrame()
        {
        super();
        setLayout(new FlowLayout());
        mb = new Button("Pull");
        mb.addActionListener(this);
        add(mb);
        mc1 = new MyComponent(Color.red);
        add(mc1);
        mc2 = new MyComponent(Color.blue);
        add(mc2);
        addWindowListener(this);
        }

        public void actionPerformed(ActionEvent e)
        {
        MyFrame mf2 = new MyFrame();
        mf2.setBounds(200,200,300,300);
        mf2.setVisible(true);
        mf2.mc1.requestFocus();
        }

            public void windowOpened(WindowEvent e)
            {
            }
            public void windowClosing(WindowEvent e)
            {
            }
            public void windowClosed(WindowEvent e)
            {
            }
            public void windowIconified(WindowEvent e)
            {
            }
            public void windowDeiconified(WindowEvent e)
            {
            }
            public void windowActivated(WindowEvent e)
            {
        mc1.requestFocus();
        }
            public void windowDeactivated(WindowEvent e)
            {
        mc2.requestFocus();
            }
        }

        class MyComponent extends Component
        {
        public MyComponent(Color c)
        {
        super();
        setBackground(c);
        }

        public void paint(Graphics g)
        {
        Dimension d = getSize();
        g.setColor(getBackground());
        g.fillRect(0,0,d.width,d.height);
        }

        public boolean isFocusTraversable()
        {
        return true;
        }

        public Dimension getPreferredSize()
        {
        return new Dimension(50,50);
        }
        }


        --------b4111098.html------

        <html>
          <head>
            <title>Bug 4111098</title>
          </head>

          <body>
         
        <APPLET CODE="b4111098.class"
                    WIDTH=400
                    HEIGHT=400></APPLET>
         
          </body>
        </html>

              feckssunw Fred Ecks (Inactive)
              mmuellersunw Marianne Mueller (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: