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

Mac: Screen.getBounds() and Screen.getVisualBounds() return strange values for secondary screens on MacOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 7u6
    • javafx
    • None
    • MacOS 10.7.4, Java7u7

      My objective is to manually expand a stage onto a secondary screen.

      On MacOS, the values returned for my screens are as follows:

      Primary screen:
      Bounds:
      height: 1440.0
      width: 2560.0
      minX: 0.0
      minY: 0.0
      maxX: 2560.0
      maxY: 1440.0

      Visual Bounds:
      height: 1418.0
      width: 2556.0
      minX: 4.0
      minY: 22.0
      maxX: 2560.0
      maxY: 1440.0

      This seems to be correct, visual bounds are inside the bounds for that screen.

      For my secondary screen the values are:
      bounds:
      height: 768.0
      width: 1024.0
      minX: 4240.0
      minY: 672.0
      maxX: 5264.0
      maxY: 1440.0

      visual bounds:
      height: 768.0
      width: 1024.0
      minX: 4240.0
      minY: -672.0
      maxX: 5264.0
      maxY: 96.0

      The X bounds seem to be correct, wheras the Y bounds are not. The actual minY coordinate is 0, placing the window on either -672.0 or +672.0 hides half of the stage.

      Altering the screen positioning does not help either. Setting the fullScreen property on the stage correctly places the stage to cover all of the screen (for various reasons I do not want to use that feature).

      Plz find attached a screenshot of my screen positioning from MacOS Control Panel. This setup consist of three screens, but is reproducibly for me with two screens as well.

            anthony Anthony Petrov (Inactive)
            fbrucknerjfx Florian Bruckner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: