← Back to team overview

openjdk team mailing list archive

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

 

You have been subscribed to a public bug:

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);
    }

}

** Affects: openjdk-6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
GraphicsEnvironment.getMaximumWindowBounds() returns wrong horizontal size in dual screen environment
https://bugs.launchpad.net/bugs/1171563
You received this bug notification because you are a member of OpenJDK, which is subscribed to openjdk-6 in Ubuntu.


References