Skip to content

Conversation

@prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Jan 23, 2026

Arrow icon of JMenuItem in JMenu which is used to invoke the submenu overlaps with the menutext if the text is long.

Fix is made to add a gap for arrow icon rect too similar to menu text and accelerator rects


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8374506: Incorrect positioning of arrow icon in parent JMenu in Windows L&F (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29375/head:pull/29375
$ git checkout pull/29375

Update a local copy of the PR:
$ git checkout pull/29375
$ git pull https://git.openjdk.org/jdk.git pull/29375/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29375

View PR using the GUI difftool:
$ git pr show -t 29375

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29375.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 23, 2026

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 23, 2026

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8374506: Incorrect positioning of arrow icon in parent JMenu in Windows L&F

Reviewed-by: aivanov, kizune

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 97 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Jan 23, 2026
@openjdk
Copy link

openjdk bot commented Jan 23, 2026

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 23, 2026
@mlbridge
Copy link

mlbridge bot commented Jan 23, 2026

Webrevs

@prrace
Copy link
Contributor

prrace commented Jan 27, 2026

@TejeshR13 @DamonGuy @azuev-java please review

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not completely against this as an interim fix…
Yet the submenu arrow now is nearly at the very edge of the menu — there has to be a margin. When the submenu opens, it now covers the arrow, but it shouldn't. At least this is how it looks in native Win32 applications.

This fix is yet another patch to fit more information into the same amount of space.

The underlying problem remains unaddressed. In the fix for JDK-8348760 in #23324, you added another column into Windows L&F menu layout, but you didn't increase the width of the menu to accommodate for the new column. Instead, you're trying to tweak coordinates of each element in the menu layout to fit more information into the same space.

I keep saying since that initial code review for #23324, for example here, and I repeat it here:

The popup menu has to become wider if both check marks / bullets and icons are rendered at the same time.

Unless you make the menu wider to accommodate the newly added column, the menu looks crammed with inconsistent margins between elements.

@azuev-java
Copy link
Member

With the fix it is better than without the fix - that is for sure, but the overall layout looks strange and majority of the arrow icon is being hidden behind the submenu's popup which is wrong. I am approving it as a stopgap solution but the overall we might want to re-visit how we calculate layouts of menu items to make it look more like a OS native menus.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 29, 2026
Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @azuev-java, it looks better this way.

@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 30, 2026

Going to push as commit 9a10cce.
Since your change was applied there have been 101 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 30, 2026
@openjdk openjdk bot closed this Jan 30, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 30, 2026
@openjdk
Copy link

openjdk bot commented Jan 30, 2026

@prsadhuk Pushed as commit 9a10cce.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@prsadhuk prsadhuk deleted the JDK-8374506 branch January 30, 2026 03:21
@aivanov-jdk
Copy link
Member

The popup menu has to become wider if both check marks / bullets and icons are rendered at the same time.

I am approving it as a stopgap solution but the overall we might want to re-visit how we calculate layouts of menu items to make it look more like a OS native menus.

I've now submitted JDK-8376828: Improve JMenuItem layout in Windows L&F.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants