<AWT Dev> RFR: 8243925 Toolkit#getScreenInsets() returns wrong value on HiDPI screens (Windows)

Philip Race philip.race at oracle.com
Fri May 15 15:01:47 UTC 2020


The whole point is to test a headful config and in any case  :-

https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Toolkit.html#getScreenInsets(java.awt.GraphicsConfiguration)

publicInsets  <https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Insets.html>  getScreenInsets​(GraphicsConfiguration  <https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/GraphicsConfiguration.html>  gc)
                        throwsHeadlessException  <https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/HeadlessException.html>

Gets the insets of the screen.

Parameters:
    |gc| - a |GraphicsConfiguration|
Returns:
    the insets of this toolkit's screen, in pixels.
Throws:
    |HeadlessException
    <https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/HeadlessException.html>|
    - if GraphicsEnvironment.isHeadless() returns true
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

-phil


On 5/15/20, 3:31 AM, Prasanta Sadhukhan wrote:
>
> On 15-May-20 3:59 PM, Sergey Bylokhov wrote:
>> On 5/14/20 10:52 pm, Prasanta Sadhukhan wrote:
>>> I believe the test should not be marked headful as no visible 
>>> component is being shown. Rest looks ok.
>>
>> If this keyword will be removed then the test will be skipped during 
>> our headful testing on headful systems.
>>
> Yes, but what is the problem if it will be tested as headless? why 
> there is a need to test on headful systems?
>>> Regards
>>> Prasanta
>>> On 14-May-20 7:44 PM, Sergey Bylokhov wrote:
>>>> On 5/13/20 11:51 pm, Prasanta Sadhukhan wrote:
>>>>> Shouldn't we need to use ScaleDownY() for top and bottom?
>>>>> Also, I think you like to rename runPocess() to runProcess() in 
>>>>> the test ?
>>>>
>>>> Right! I have also updated the test from which I copied the typo:
>>>> http://cr.openjdk.java.net/~serb/8243925/webrev.05
>>>>
>>>>>
>>>>> Regards
>>>>> Prasanta
>>>>> On 08-May-20 11:39 AM, Sergey Bylokhov wrote:
>>>>>> Hi, Prasanta.
>>>>>>
>>>>>> On Linux, it should generally pass because we already scale the 
>>>>>> insets there,
>>>>>> but sometimes this test fails due to size mismatches, we have 
>>>>>> some rounding
>>>>>> issues during the calculation and conversion from the device to 
>>>>>> userspace.
>>>>>>
>>>>>> It looks like when I commented out the fractional scales I also 
>>>>>> accidentally
>>>>>> delete the assertion in the test.
>>>>>>
>>>>>> Here is an update test:
>>>>>> http://cr.openjdk.java.net/~serb/8243925/webrev.04
>>>>>> The fractional scales were returned, but the test is excluded on 
>>>>>> Linux. I
>>>>>> will fix that separately.
>>>>>>
>>>>>>
>>>>>> On 5/7/20 2:27 am, Prasanta Sadhukhan wrote:
>>>>>>> Hi Sergey,
>>>>>>>
>>>>>>> The regression test pass for me on windows and linux even 
>>>>>>> without the fix
>>>>>>>
>>>>>>> Regards
>>>>>>> Prasanta
>>>>>>> On 30-Apr-20 3:10 AM, Sergey Bylokhov wrote:
>>>>>>>> Hello.
>>>>>>>> Please review the fix for jdk/client.
>>>>>>>>
>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8243925
>>>>>>>> Fix: http://cr.openjdk.java.net/~serb/8243925/webrev.02
>>>>>>>>
>>>>>>>> One more place when we return the data in pixels, without
>>>>>>>> proper conversation to the user's space.
>>>>>>>>
>>>>>>>> On macOS, this conversion is done by the OS, on Linux we already
>>>>>>>> convert the data. The only missing platform is Windows. Note that
>>>>>>>> we still have an inadequate specification for this and some other
>>>>>>>> Toolkit API which states that results are in "in pixels".
>>>>>>>>
>>>>>>>> I will file the separate bug to update the spec because this bug
>>>>>>>> I would like to backport to 11.
>>>>>>>>
>>>>>>>> The bug was found during work on
>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8231564
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200515/6c57f887/attachment.htm>


More information about the awt-dev mailing list