<AWT Dev> [11] JDK-8196006: java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java fails

Shashidhara Veerabhadraiah shashidhara.veerabhadraiah at oracle.com
Sat Feb 3 07:50:50 UTC 2018


Hi Sergey, Main reason to change the test to run on the main screen is that the test runs thro's different graphics configurations whereas keeping the AWT frame in the same main screen. This leads to wrong calculations. Also for the intent of the test it is not required to run on all the graphics configurations.

The problem is that getBounds() of the GraphicsConfiguration class returns the scaled size which is used as an initial input to set the maximized bounds by calling setMaximizedBounds(). As you said, frame.getBounds() returns the user space size. Hence we would need to transform it.

Thanks and regards,
Shashi

-----Original Message-----
From: Sergey Bylokhov 
Sent: Saturday, February 3, 2018 12:20 PM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [11] JDK-8196006: java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java fails

Hi, Shashi.

Before this fix this test was executed on all screens on the system.
Why have you changed it to test only main screen?

If I understand the code correctly the test checks the size which is passed to frame.setMaximizedBounds() and the size which is returned by frame.getBounds(). In both cases the size should be in the users space(not in pixels). Why additional transform(added in the fix) is necessary?

On 01/02/2018 20:39, Shashidhara Veerabhadraiah wrote:
> Hi All, Please review a fix for the test bug.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8196006
> 
> Webrev: http://cr.openjdk.java.net/~sveerabhadra/8196006/webrev.00/
> 
> Summary: This test fails on a hidpi monitor whereas passes on a normal 
> monitor. Now the calculations are altered to take care of the scaling 
> factor of the primary display unit. Now this test passes on both 
> normal and hidpi monitors.
> 
> Thanks and regards,
> 
> Shashi
> 


--
Best regards, Sergey.


More information about the awt-dev mailing list