<Swing Dev> [11] RFR:JDK-8176359: Frame#setMaximizedbounds not working properly in multi screen environments
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Wed Aug 1 00:00:38 UTC 2018
On 06/07/2018 01:33, Krishna Addepalli wrote:
> 3. There are some scaling combinations, like (1.75 * 2.5) monitor scaling, and java uiScaling 1.25/1.5 which are failing.
But why it does not work in these combinations? Do we have some round
errors in logic which converts pixels to units?
>
> So, I have added back the uiScaling tests, and here is the new webrev: http://cr.openjdk.java.net/~kaddepalli/8176359/webrev03/
>
> Thanks,
> Krishna
>
> -----Original Message-----
> From: Sergey Bylokhov
> Sent: Thursday, July 5, 2018 7:54 PM
> To: Krishna Addepalli <krishna.addepalli at oracle.com>; swing-dev at openjdk.java.net
> Subject: Re: <Swing Dev> [11] RFR:JDK-8176359: Frame#setMaximizedbounds not working properly in multi screen environments
>
> On 05/07/2018 14:38, Krishna Addepalli wrote:
>> Hi Sergey,
>>
>> 1. If I add the scaling, the test will always fail, even though it passes for scale = 1, it will fail for other values (1.25, 1.5, 1.75).
>
> What is the reason of the failure?
>
>> 2. Yes, I have added code to get the current screen on which the point lies, and use the scale of that screen.
>> 3. Thanks for pointing that out, fixed it in the new webrev.
>>
>> Here is the new webrev:
>> http://cr.openjdk.java.net/~kaddepalli/8176359/webrev02/
>>
>> Thanks,
>> Krishna
>>
>> -----Original Message-----
>> From: Sergey Bylokhov
>> Sent: Saturday, June 30, 2018 1:40 AM
>> To: Krishna Addepalli <krishna.addepalli at oracle.com>;
>> swing-dev at openjdk.java.net
>> Subject: Re: <Swing Dev> [11] RFR:JDK-8176359:
>> Frame#setMaximizedbounds not working properly in multi screen
>> environments
>>
>> Hi, Krishna.
>>> Also, while running the testcase, I discovered that the
>>> -Dsun.java2d.uiScale=1.25 will uniformly apply the scaling across all
>>> the screens, whereas if the underlying monitor is not scaled, the
>>> results will be different.
>>>
>>> Hence I modified the test to remove the uiScale settings related tests.
>>
>> I suggest to add it back. The case when the bug can be reproduced depends from the real screen resolution. If such resolution is set then the bug should not depend from the scales of the screens, because internally we will convert the scaled coordinates to the real pixels and it does not matter what scale is used in java.
>>
>> There some questionable places in the fix:
>> - 106 b = scaleBounds(b, currScaleX, currScaleY); Why the scale of the current screen is used? I guess we need to find on which screen this "b"
>> is located and then use its scale. Check implementation of
>> WWindowPeer.setBounds()
>>
>> - Is it intentional to assign to "b" a values from "primaryDevBounds", which was not scaled? So in some cases the "b" will have scaled values and in some cases not.
>> 125 b.width = primaryDevBounds.width;
>> 130 b.height = primaryDevBounds.height;
>> 134 b.x = primaryDevBounds.x;
>> 138 b.y = primaryDevBounds.y;
>>
>>
>> --
>> Best regards, Sergey.
>>
>
>
> --
> Best regards, Sergey.
>
--
Best regards, Sergey.
More information about the swing-dev
mailing list