Skip to content

8307325: Verify the focus owner when non focused windows requesting focus#13790

Closed
ravigupta30 wants to merge 2 commits intoopenjdk:masterfrom
ravigupta30:8307325
Closed

8307325: Verify the focus owner when non focused windows requesting focus#13790
ravigupta30 wants to merge 2 commits intoopenjdk:masterfrom
ravigupta30:8307325

Conversation

@ravigupta30
Copy link
Contributor

@ravigupta30 ravigupta30 commented May 4, 2023

Write a test Check, when the top level Window is not the focused Window requesting for focus and becoming the Focus Owner for any Component in that Window checking the following

1.The Component is the Focus Owner and the Window becomes the focused Window If the platform supports cross requesting focus
across Windows.
2.The request is remembered and be granted when the Window is later focused If the platform does not support requesting focus
across Windows.

Testing:
Tested using Mach5(20 times per platform) in macos,linux and windows and got all pass.


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-8307325: Verify the focus owner when non focused windows requesting focus (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13790

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 4, 2023

👋 Welcome back ravigupta30! 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 May 4, 2023

@ravigupta30 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 client client-libs-dev@openjdk.org label May 4, 2023
@ravigupta30 ravigupta30 changed the title Verify the focus owner when non focused windows requesting focus 8307325: Verify the focus owner when non focused windows requesting focus May 4, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label May 4, 2023
@mlbridge
Copy link

mlbridge bot commented May 4, 2023

Webrevs

@ravigupta30
Copy link
Contributor Author

Any volunteers for a review?

}

private static void initializeGUI() {
frame1 = new Frame("Test Frame1");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these frames be named something specific to the test?

Copy link
Member

Choose a reason for hiding this comment

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

Should these frames be named something specific to the test?

I agree, more specific caption could help diagnose which test left frames open.

@ravigupta30
Copy link
Contributor Author

Any volunteers for a review?

public class CrossFocusRequestTest {

private static Frame frame1, frame2;
private volatile static Button button;
Copy link
Member

Choose a reason for hiding this comment

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

Please use the blessed modifier order: private static volatile.

In fact, neither button nor textField need to be volatile.

Comment on lines +92 to +95
robot.mouseMove(compAt.x + compSize.width / 2,
compAt.y + compSize.height - 20);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
Copy link
Member

Choose a reason for hiding this comment

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

How does it test that the requestFocus works across frames?!

You click the text field in the first frame, which grants the focus to the text field irrespective whether requestFocus was called or not.

It does not make sense to me.

}

private static void initializeGUI() {
frame1 = new Frame("Test Frame1");
Copy link
Member

Choose a reason for hiding this comment

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

Should these frames be named something specific to the test?

I agree, more specific caption could help diagnose which test left frames open.

frame2.setVisible(true);
}

public static void disposeFrame() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public static void disposeFrame() {
private static void disposeFrames() {

initializeGUI is private, why is disposeFrame public?

Since you have two frames, using plural is better.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 26, 2023

@ravigupta30 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 24, 2023

@ravigupta30 This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Aug 24, 2023
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 rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

5 participants