RFR: 8288325: [windows] Actual and Preferred Size of AWT Non-resizable frame are different

Harshitha Onkar honkar at openjdk.org
Mon Aug 22 21:16:35 UTC 2022


On Mon, 22 Aug 2022 20:38:30 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> Does it mean that now we will always request the insets from the platform?

**_Yes the following block of code runs when window isn't sized yet (first time) or when the incoming taget is a frame to obtain platform insets_**

> Was this code run before the frame was changed from resizeable to non-resizeable? Therefore the insets weren't updated correctly.

 _**It was not going into this block for resizable frames. The issue was with the cached insets. The first time when frame,pack() is called on non-resizable frame the correct insets associated with it is returned and the frame is sized accordingly. But any subsequent calls to frame.getInsets() or frame.getPreferredSize() which gets the cached insets from [WPanelPeer](https://github.com/openjdk/jdk/blob/27af0144ea57e86d9b81c2b328fad66e4a046f61/src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java#L62) was returning the cached insets of Resizable frame and not that of the Non-Resizable frame**_

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

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



More information about the client-libs-dev mailing list