← Back to team overview

openjdk team mailing list archive

[Bug 1171563] Re: GraphicsEnvironment.getMaximumWindowBounds() returns wrong horizontal size in dual screen environment

 

** Bug watch added: JOSM bug tracker #9699
   http://josm.openstreetmap.de/ticket/9699

** Also affects: josm via
   http://josm.openstreetmap.de/ticket/9699
   Importance: Unknown
       Status: Unknown

** Changed in: josm
   Importance: Unknown => Critical

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-7 in Ubuntu.
https://bugs.launchpad.net/bugs/1171563

Title:
  GraphicsEnvironment.getMaximumWindowBounds() returns wrong horizontal
  size in dual screen environment

Status in Java OpenStreetMap editor:
  Unknown
Status in “openjdk-7” package in Ubuntu:
  Confirmed

Bug description:
  GraphicsEnvironment.getMaximumWindowBounds() is a function supplied to
  openjdk to determine the largest size window which fits in the current
  desktop environment on a single display, taking into account OS menu
  bars. See
  http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/GraphicsEnvironment.html#getMaximumWindowBounds()

  Running the attached program on my system returns

  thue@Thue-Desktop:~$ java test 
  java.awt.Rectangle[x=3265,y=24,width=255,height=1176]

  So GraphicsEnvironment.getMaximumWindowBounds() thinks that there is
  only room for a 255 pixel wide window on my desktop. Which is
  obviously silly

  I have a fairly standard dual-screen setup, with the left screen 1600
  wide and the right screen 1920 wide. Java is trying to open the Window
  on the right screen. The width of 255 is very probably
  1920-1600-65=255, where 65 pixels is the width of the unity menu as
  measured via a screenshot in GIMP.

  I encountered the problem while trying to run the April 22 git version
  of FreeCol. The example code below is snipped from there.

  Both Java 6 and Java 7 have the problem.

  Regards, Thue

  ----------------------

  import java.awt.GraphicsEnvironment;
  import java.awt.Rectangle;

  class test {

      public static void main(String[] args) {
          determineWindowSize();
      }

      public static void determineWindowSize() {
          final GraphicsEnvironment lge
              = GraphicsEnvironment.getLocalGraphicsEnvironment();

          Rectangle bounds = lge.getMaximumWindowBounds();
          System.out.println(bounds);
      }

  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/josm/+bug/1171563/+subscriptions


References