On Thu, 30 May 2024 12:05:25 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> Issue is in macosx, when a JMenu or JPopupmenu is opened and then window is 
> resized from the lower right corner, then the Menu / JPopupmenu stays open 
> unlike in native osx apps like Notes, Mail etc..
> 
> This is because when LMouseButton is pressed on non-client area, the window 
> should get a UngrabEvent for it to close/cancel the popupmenu (as is done in 
> [windows](https://github.com/openjdk/jdk/blob/f608918df3f887277845db383cf07b0863bba615/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp#L618-L620))
>  but it was seen that the mac AWTWindow code only recognizes the title-bar as 
> the non-client area so 
> [notifyNCMouseDown](https://github.com/openjdk/jdk/blob/f608918df3f887277845db383cf07b0863bba615/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java#L797-L804)
>  is not called.
> Fix is made to recognize the edges of the window as non-client area

This pull request has now been integrated.

Changeset: 1c514b34
Author:    Prasanta Sadhukhan <psadhuk...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/1c514b34c0260823e70f209996ac933a76ac34c2
Stats:     125 lines in 2 files changed: 124 ins; 0 del; 1 mod

8325435: [macos] Menu or JPopupMenu not closed when main window is resized

Reviewed-by: azvegint

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

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

Reply via email to