On Mon, 22 Aug 2022 20:38:30 GMT, Alexey Ivanov <[email protected]> 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

Reply via email to