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

[macosx] getLocationOnScreen returns 0 if parent invisible

    Details

    • Subcomponent:
    • Introduced In Build:
      b112
    • Introduced In Version:
      8
    • Resolved In Build:
      b115
    • OS:
      os_x
    • Verification:
      Verified

      Backports

        Description

        In jdk8 b112 there seems to be a regression on OS X.
        Run the attached test. It will show a Window with invisible Frame parent correctly at the center of the screen. Wait for 3 seconds for printout. With b111 and earlier, there will be a correct location point reported.
        However with b112, there will be always 0.

        Works OK on Linux.
        1. RelTo.java
          0.9 kB
          Yuri Nesterenko
        2. Test.java
          1 kB
          Petr Pchelko

          Activity

          Hide
          serb Sergey Bylokhov added a comment -
          But you can simply change
                  final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
                          ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
          to
                  final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
                          ownerPtr, styleBits, 0, 0 1, 1);
          I guess it should wok too.


          JDK-8007219 has a test which can be used for validation.
          Show
          serb Sergey Bylokhov added a comment - But you can simply change         final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),                 ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height); to         final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),                 ownerPtr, styleBits, 0, 0 1, 1); I guess it should wok too. JDK-8007219 has a test which can be used for validation.
          Hide
          anthony Anthony Petrov (Inactive) added a comment -
          To comment on Petr's comment: zero coordinates can work fine. However, please don't use zeros for the window size. Make it at least 1x1 pixels. Many native platforms just can't work normally with zero-sized windows.
          Show
          anthony Anthony Petrov (Inactive) added a comment - To comment on Petr's comment: zero coordinates can work fine. However, please don't use zeros for the window size. Make it at least 1x1 pixels. Many native platforms just can't work normally with zero-sized windows.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/c561db53a24c
          User: pchelko
          Date: 2013-10-24 15:50:05 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/c561db53a24c User: pchelko Date: 2013-10-24 15:50:05 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/c561db53a24c
          User: lana
          Date: 2013-11-05 21:09:17 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/c561db53a24c User: lana Date: 2013-11-05 21:09:17 +0000
          Hide
          dermashov Dmitriy Ermashov (Inactive) added a comment -
          Verified in jdk8b115

          Test test/java/awt/Window/8027025/Test8027025.java passed successful

          Environment:
          OS X 10.9 x64
          java version "1.8.0-ea"
          Java(TM) SE Runtime Environment (build 1.8.0-ea-b115)
          Java HotSpot(TM) 64-Bit Server VM (build 25.0-b57, mixed mode)
          Show
          dermashov Dmitriy Ermashov (Inactive) added a comment - Verified in jdk8b115 Test test/java/awt/Window/8027025/Test8027025.java passed successful Environment: OS X 10.9 x64 java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b115) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b57, mixed mode)

            People

            • Assignee:
              pchelko Petr Pchelko (Inactive)
              Reporter:
              yan Yuri Nesterenko (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: