Skip to content

8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard#7396

Closed
prsadhuk wants to merge 5 commits intoopenjdk:masterfrom
prsadhuk:JDK-8277369
Closed

8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard#7396
prsadhuk wants to merge 5 commits intoopenjdk:masterfrom
prsadhuk:JDK-8277369

Conversation

@prsadhuk
Copy link
Copy Markdown
Contributor

@prsadhuk prsadhuk commented Feb 9, 2022

After applying setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT) to the JMenuBar the arrow keys started to behave the opposite of what expected. Right arrow goes left and Left arrow goes right when trying to traverse through keyboard.

Fixed to reverse the direction traversal for RTL orientation.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7396/head:pull/7396
$ git checkout pull/7396

Update a local copy of the PR:
$ git checkout pull/7396
$ git pull https://git.openjdk.java.net/jdk pull/7396/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7396

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7396.diff

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Feb 9, 2022

👋 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
Copy Markdown

openjdk bot commented Feb 9, 2022

@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 Feb 9, 2022
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Feb 9, 2022

Webrevs


static volatile boolean passed = false;

public static void main(String[] args) throws Exception {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The submitter said that he use the native L&F should not we check it in the test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Might as well. Added L&F iteration in the test.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Feb 11, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 14, 2022
Copy link
Copy Markdown
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

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

Seems to me right should move right and left move left, so OK by me but
I'd like to make sure this is seen by @naotoj too.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 14, 2022

@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:

8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard

Reviewed-by: prr, naoto, serb

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 121 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 ready Pull request is ready to be integrated label Feb 14, 2022
@naotoj
Copy link
Copy Markdown
Member

naotoj commented Feb 14, 2022

Caret should move visually, so VK_RIGHT should move it to the right. Fine by me.

@prrace
Copy link
Copy Markdown
Contributor

prrace commented Feb 15, 2022

BTW I was just looking around and if you do a google search on "rtl arrow key backward" it looks to me as if multiple unrelated open source projects happen to have had the same issue (not SFAICT Java based) and came to the same conclusion.

@prsadhuk
Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 24, 2022

Going to push as commit 379fd85.
Since your change was applied there have been 233 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 Feb 24, 2022
@openjdk openjdk bot closed this Feb 24, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 24, 2022
@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 24, 2022

@prsadhuk Pushed as commit 379fd85.

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

@prsadhuk prsadhuk deleted the JDK-8277369 branch February 24, 2022 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants