RFR: 8265586: [windows] last button is not shown in AWT Frame with BorderLayout and MenuBar set. [v2]

Harshitha Onkar honkar at openjdk.java.net
Sat Jun 11 00:49:10 UTC 2022


On Sat, 11 Jun 2022 00:30:20 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/awt_Window.cpp line 1440:
>> 
>>> 1438:                     ::GetSystemMetrics(SM_CXDLGFRAME);
>>> 1439:                 m_insets.top = m_insets.bottom =
>>> 1440:                     ::GetSystemMetrics(SM_CYDLGFRAME);
>> 
>> It's likely needed here as well.
>> 
>> Make the frame non-resizeable to get into this block.
>
> Added `SM_CXPADDEDBORDER` to Non-Resizable Frames. After the addition of padded border the second button is being shown similar to Resizable frames. But unlike resizable frames,  for the non-resizable frames - the actual frame size and the preferred size are different. Ideally the frame.getSize() should be equal to preferred size when frame.pack() is used.

Side-by-Side comparison of Resizable and Non-Resizable frames  - Resizable frame slightly wider and taller compared to non-resizable. 

On UiScale =1,
Resizable Frame size= java.awt.Dimension[width=241,height=119]
Non-Resizable Frame size = java.awt.Dimension[width=237,height=115]

![image](https://user-images.githubusercontent.com/95945681/173165801-a387f853-bff0-4c16-ba83-056069137dac.png)

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

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



More information about the client-libs-dev mailing list