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

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri May 31 12:24:42 UTC 2024


> 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

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  Non-client aread edge area modified, test format

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19474/files
  - new: https://git.openjdk.org/jdk/pull/19474/files/4b22432b..d2f9256b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=19474&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=19474&range=00-01

  Stats: 17 lines in 2 files changed: 8 ins; 0 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/19474.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19474/head:pull/19474

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


More information about the client-libs-dev mailing list