On Fri, 10 Jun 2022 12:12:31 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Due to incorrect AWT Frame inset values being returned from native code, few 
>> of the components in the frame were not being shown completely on Windows. 
>> With the proposed fix, correct insets are obtained which in turn sizes and 
>> displays the frame correctly.
>> 
>> The default insets obtained from the Win system was adding only 
>> `::GetSystemMetrics(SM_CXSIZEFRAME)` for **WS_THICKFRAME** and the insets 
>> were off by 6px from the expected value. 
>> `::GetSystemMetrics(SM_CXPADDEDBORDER)` is additionally added to top, 
>> bottom, left and right insets to account for the 6px. [GetSystemMetric() 
>> Document](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetrics)
>> 
>> A test case is added which checks if the actual frame size is equal to the 
>> expected frame size (frame.getSize() == frame.getPreferredSize()), thus 
>> checking if frame.pack() works as expected.
>> 
>> Following are before and after screenshots - 
>> ![image](https://user-images.githubusercontent.com/95945681/172999272-981a0b07-2bd1-425c-b73d-f21f68922262.png)
>
> Changes requested by aivanov (Reviewer).

@aivanov-jdk Thank you for reviewing. I'll have the suggested changes fixed in 
the next commit.

-------------

PR: https://git.openjdk.org/jdk/pull/9118

Reply via email to