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

[macosx] Frame warps to lower left of screen when displayed

    Details

    • Subcomponent:
    • Resolved In Build:
      b68
    • CPU:
      x86
    • OS:
      os_x

      Backports

        Description

        FULL PRODUCT VERSION :
        Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
        Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        MacOS 10.9.5, 10.10

        A DESCRIPTION OF THE PROBLEM :
        I have found that displaying a frame can cause the frame to warp to the lower left corner of the screen, similar to the effect reported in bug 8032595 (which is reportedly fixed in this release). Two conditions appear to be necessary: Before making the frame visible, the frame is first packed, then resized with a height close to or greater than the available screen height.


        REGRESSION. Last worked in version 7u45

        ADDITIONAL REGRESSION INFORMATION:
        Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
        Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        The following test program illustrates.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The frame should be visible and (nearly) fill the screen.
        ACTUAL -
        The top of the frame is near the bottom of the screen, so that the frame is mostly not visible.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        package test;

        import javax.swing.*;
        import java.awt.*;

        public class Main
        {
            public Main()
            {
                int offset = 10; // the bug happens when offset is <= 10
                GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
                Rectangle gb = gc.getBounds();
                Insets s = Toolkit.getDefaultToolkit().getScreenInsets(gc);
                Rectangle r = new Rectangle(gb.x + s.left, gb.y + s.top, gb.width - s.left - s.right, gb.height - s.top - s.bottom - offset);
                final JFrame w = new JFrame();
                w.pack(); // necessary to show the bug
                w.setBounds(r);
                w.setVisible(true);
            }

            public static void main(String[] args)
            {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        new Main();
                    }
                });
            }
        }

        // not affected by dock position or hiding
        // not affected by screen menu bar
        // happens in JDK 8u25, not in JDK 7

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Don't pack or don't make the frame too tall.

          Issue Links

            Activity

            Hide
            pardesha Pardeep Sharma added a comment -
            Tested this with JDK 7u40, 8u25 and 8u40 on MAC OS X and couldn't reproduce the issue. Sent an email to submitter to reconfirm the status with 8u25 and JDK 9 (apparent fix, ref: JDK-8032595)
            Show
            pardesha Pardeep Sharma added a comment - Tested this with JDK 7u40, 8u25 and 8u40 on MAC OS X and couldn't reproduce the issue. Sent an email to submitter to reconfirm the status with 8u25 and JDK 9 (apparent fix, ref: JDK-8032595 )
            Hide
            vdyakov Victor Dyakov added a comment -
            please re-open once replied back
            Show
            vdyakov Victor Dyakov added a comment - please re-open once replied back
            Hide
            pardesha Pardeep Sharma added a comment -
            Response from the submitter:
            "I tried my test program using 8u25 and 9 build 39. I ran it several times using both versions of Java. There was one time when the window displayed normally, but every other time it warped to the lower left of the screen. I also noticed small variations in the appearance of the window, see attached screen shots.

            I ran the program on OS 10.10.1 and 10.9.5 and I ran it in a guest account. The problem occurred in all those environments. Here is the problem on 10.9.5 (attached image)

            Here is the problem on 10.10.1 using a guest account. The dock is not visible because it has fewer items and does not reach the corner of the screen. (attached image)

            Both of these show display artifacts. They go away when I resize the window.

            My system is a 27” Late 2009 iMac with ATI Radeon HD 4850 512 MB."
            Show
            pardesha Pardeep Sharma added a comment - Response from the submitter: "I tried my test program using 8u25 and 9 build 39. I ran it several times using both versions of Java. There was one time when the window displayed normally, but every other time it warped to the lower left of the screen. I also noticed small variations in the appearance of the window, see attached screen shots. I ran the program on OS 10.10.1 and 10.9.5 and I ran it in a guest account. The problem occurred in all those environments. Here is the problem on 10.9.5 (attached image) Here is the problem on 10.10.1 using a guest account. The dock is not visible because it has fewer items and does not reach the corner of the screen. (attached image) Both of these show display artifacts. They go away when I resize the window. My system is a 27” Late 2009 iMac with ATI Radeon HD 4850 512 MB."
            Hide
            alexsch Alexander Scherbatiy (Inactive) added a comment - - edited
            Mac OS X treats a window which has maximal sizes as zoomed and maximized.
            Frame.setVisible(true) checks that the window has NORMAL state by default tries to unmaximize it but zoom() operation leads that the window is zoomed to the previous size which is zero.
            Show
            alexsch Alexander Scherbatiy (Inactive) added a comment - - edited Mac OS X treats a window which has maximal sizes as zoomed and maximized. Frame.setVisible(true) checks that the window has NORMAL state by default tries to unmaximize it but zoom() operation leads that the window is zoomed to the previous size which is zero.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/1457bd69ac5a
            User: alexsch
            Date: 2015-05-22 11:05:04 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/1457bd69ac5a User: alexsch Date: 2015-05-22 11:05:04 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/1457bd69ac5a
            User: lana
            Date: 2015-06-10 21:24:34 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/1457bd69ac5a User: lana Date: 2015-06-10 21:24:34 +0000

              People

              • Assignee:
                alexsch Alexander Scherbatiy (Inactive)
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: