<AWT Dev> [9] Review request for 8176097 Window set location to a display with different DPI does not properly work

Alexander Zvegintsev alexander.zvegintsev at oracle.com
Sun Mar 5 20:34:12 UTC 2017


+1

--
Thanks,
Alexander.

On 05.03.2017 21:25, Sergey Bylokhov wrote:
> Looks fine.
>
>> Hello,
>>
>> Could you review the updated fix:
>>   http://cr.openjdk.java.net/~alexsch/8176097/webrev.02
>>
>>   - sysX and sysY values are kept the the same as the passed x and y values.
>>
>> Thanks,
>> Alexandr.
>>
>> On 3/3/2017 8:19 PM, Alexandr Scherbatiy wrote:
>>> Hello,
>>>
>>> Could you review the updated fix:
>>>   http://cr.openjdk.java.net/~alexsch/8176097/webrev.01
>>>
>>>   - sysX and sysY values are updated in the same way as x and y in the WWindowPeer.setBounds(...) method.
>>>
>>> Thanks,
>>> Alexandr.
>>>
>>> On 3/2/2017 10:13 PM, Sergey Bylokhov wrote:
>>>> Hi, Alex.
>>>> Looks like after the fix the fields in sysX/Y and sysW/sysH will have incompatible values, the location will use the one screen to scale and the size will use another, Is it possible to store the location+size based on same screen?
>>>>
>>>>> Hello,
>>>>>
>>>>> Could you review the fix:
>>>>>   bug: https://bugs.openjdk.java.net/browse/JDK-8176097
>>>>>   webrev: http://cr.openjdk.java.net/~alexsch/8176097/webrev.00
>>>>>
>>>>>   Suppose the system has two displays with different DPI. A user can create a window on the first screen
>>>>>   and set the windows bounds from the second screen.
>>>>>   The windows scales the given bounds from the user space (x, y, w, h) to the device space (s1 * x, s1 * y, s1 * w, s1 * h),
>>>>>   preserves the location in the device space and updates the windows size so it has the same size in the screen 2 user space.
>>>>>   (s1 * x, s1 * y, s1 * w, s1 * h) -> (s1 * x, s1 * y, [s1 * w] * s2 / s1, [s1 * h] * s2 / s1) = (s1 * x, s1 * y, s2 * w, s2 * h)
>>>>>   which is (s1 * x / s2, s1 * y / s2, w, h) in screen 2 user space.
>>>>>   This is necessary for the windows dragging from one display to another.
>>>>>
>>>>>   The fix updates the window size during the size setting if it detects that the window is located on a different screen with different DPI
>>>>>   so the the second screen scale factor is properly taken into account.
>>>>>
>>>>>   The fix also updates the Robot.createCompatibleImage() method to use the scale from the screen the the screenshot is taken.
>>>>>   See the issue JDK-8173972 createScreenCapture not working as expected on multimonitor setup with different DPI scales.
>>>>>
>>>>> Thanks,
>>>>> Alexandr.
>>>>>



More information about the awt-dev mailing list