openjdk team mailing list archive
-
openjdk team
-
Mailing list archive
-
Message #09107
[Bug 1171563] Re: GraphicsEnvironment.getMaximumWindowBounds() returns wrong horizontal size in dual screen environment
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: openjdk-7 (Ubuntu)
Status: New => Confirmed
--
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 “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/ubuntu/+source/openjdk-7/+bug/1171563/+subscriptions
References