Integrated: 8265586: [windows] last button is not shown in AWT Frame with BorderLayout and MenuBar set.
Harshitha Onkar
honkar at openjdk.java.net
Tue Jun 14 19:51:46 UTC 2022
On Fri, 10 Jun 2022 05:55:35 GMT, Harshitha Onkar <honkar at 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 few pixels 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 -
> 
This pull request has now been integrated.
Changeset: bbaeacb5
Author: Harshitha Onkar <honkar at openjdk.org>
Committer: Dmitry Markov <dmarkov at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/bbaeacb597a8acc2c88793a6231c53ea0453f4d4
Stats: 111 lines in 2 files changed: 104 ins; 3 del; 4 mod
8265586: [windows] last button is not shown in AWT Frame with BorderLayout and MenuBar set.
Reviewed-by: aivanov, dmarkov, azvegint
-------------
PR: https://git.openjdk.org/jdk/pull/9118
More information about the client-libs-dev
mailing list