RFR: 8078744: Right half of system menu icon on title bar does not activate when clicked in Metal L&F [v2]

Damon Nguyen dnguyen at openjdk.org
Thu Feb 26 21:16:24 UTC 2026


On Thu, 26 Feb 2026 02:54:22 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> If JFrame's window decorations is provided by the Metal LookAndFeel then system menu icon (e.g., which shows Restore, Minimize, Maximize, and Close menu options when clicked) does not activate when clicked on the right edge of the icon
>> 
>> MetalTitlePane creates a JMenuBar with a system menu icon and a JMenu when clicked on it. This JMenu is created by
>> `MetalTitlePane.createMenu`  in the title bar with an empty string and zero-width string doesn't cover the systemmenu icon to activate the menu when clicked on right edge of the icon. Changing the text of the JMenu to a non-zero width character properly sizes the menu button covering and activating the system menu icon even when clicked on right edge i.e anywhere in the icon.
>> 
>> Without fix
>> <img width="246" height="127" alt="image" src="https://github.com/user-attachments/assets/f872bd95-ea15-4245-9c88-f06834804e9b" />
>> 
>> With fix
>> <img width="190" height="134" alt="image" src="https://github.com/user-attachments/assets/f79e8e96-0c71-49e0-9501-5b3a12bbcd83" />
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update preferredsize

LGTM. Change makes sense and the area to click to open the menu looks good.

On a side note, does anyone else see an issue where resizing the Metal L&F window from the bottom-right corner gets the cursor stuck to the "resizing" visual state occasionally? It seems to occur randomly (with or without this PR's changes).

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

Marked as reviewed by dnguyen (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29808#pullrequestreview-3863454003


More information about the client-libs-dev mailing list