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

REGRESSION: Spurious COMPONENT_MOVED events sent as of b19

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b02
    • CPU:
      sparc
    • OS:
      solaris_9
    • Verification:
      Verified

      Description

      The fix for 4514547 introduced extra COMPONENT_MOVED events for top-levels that weren't sent in previous JDKs:

      * When dragging a Frame around the screen, we get two COMPONENT_MOVED events for every location that we put the Frame - one when we release the mouse at the new location (which is correct), and one when we start to drag the Frame to a new location (which is new). When this second event is set, technically the Frame has not moved anywhere.

      * When a Frame is resized by the user, but the location has not changed (i.e. the upper-left corner hasn't moved) we get both a COMPONENT_RESIZED (which is correct) and a COMPONENT_MOVED event (which is new). Again, the Frame has not actually moved.

      Don't get me wrong, 4514547 was a very important bug to fix. But if that problem could be solved without introducing these new events, that would be preferable.

      I used the following test on Solaris 9 running CDE.

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

      public class MovedTest extends Frame implements ComponentListener
      {
          public MovedTest()
          {
              super( "MoveTest" );
              addComponentListener(this);
          }

          public void componentMoved(ComponentEvent e) {
              System.out.println("componentMoved: " + e);
          }
          public void componentResized(ComponentEvent e) {
              System.out.println("componentResized: " + e);
          }
          public void componentShown(ComponentEvent e) {}
          public void componentHidden(ComponentEvent e) {}


          public static void main( String[] args )
          {
              MovedTest t = new MovedTest();
              t.setSize(100,100);
              t.show();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              son Oleg Sukhodolsky (Inactive)
              Reporter:
              bchristi Brent Christian
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: