RFR: 8288325: [windows] Actual and Preferred Size of AWT Non-resizable frame are different [v5]
Harshitha Onkar
honkar at openjdk.org
Thu Sep 22 18:42:50 UTC 2022
> On Windows, the insets obtained for a Non-Resizable AWT Frame was different when frame.pack() was called and subsequent call to frame.getInsets() or frame.getPreferredSize(). Due to this, the actual and preferred size differed when frame.pack() was called for Non-Resizable frame (on Windows).
>
> Earlier the insets returned when frame.getInsets() was called, was that of a Resizable frame and not the correct insets associated with Non-Resizable frame. Fix is added to native code to get the correct insets. The test - AwtFramePackTest.java has been updated to test actual and expected/preferred size for both Resizable and Non-Resizable Frames.
>
> The test is generic though the issue and fix is on Windows platform because the condition
> `frame.getSize() == frame.getPreferredSize()` should be true on all platforms when frame.pack() is called.
>
> Following is the link to Windows System Metrics (used for native insets) - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetrics
Harshitha Onkar has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Merge branch 'master' into NonResize_8288325
- reverted the changes related to previous fix - checking the type of target object
- updated fix to get the right insets for Non-Resizable frame
- Merge branch 'master' into NonResize_8288325
- Non-Resizable AWT Frame insets fix
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/9954/files
- new: https://git.openjdk.org/jdk/pull/9954/files/72272055..1333b824
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=9954&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=9954&range=03-04
Stats: 9937 lines in 248 files changed: 5608 ins; 3559 del; 770 mod
Patch: https://git.openjdk.org/jdk/pull/9954.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9954/head:pull/9954
PR: https://git.openjdk.org/jdk/pull/9954
More information about the client-libs-dev
mailing list