Skip to content

Conversation

@kboulanou
Copy link
Contributor

@kboulanou kboulanou commented Jun 25, 2025

Many Mixing tests failed because the work around click lands on the minimizing area in the window control and causes the tests to fail.

This fix changes the width of base frames which allows most of tests to 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-8158801: [TEST_BUG] Mixing tests fail because of focus workaround trick (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25971

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 25, 2025

👋 Welcome back kboulanou! 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 Jun 25, 2025

@kboulanou This change is no longer ready for integration - check the PR body for details.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 25, 2025
@openjdk
Copy link

openjdk bot commented Jun 25, 2025

@kboulanou 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 Jun 25, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 25, 2025

Webrevs

@prsadhuk
Copy link
Contributor

What do you mean by "focus workaround trick" and " minimizing area in the window control"? Are you seeing click is happening on the minimize button on the frame and frame getting iconified?
In that case instead of changing the frame width/height, guess you can set with frame.setUndecorated to have undecorated windows..Also, I have seen this test renders the frame on the top-left corner, it will be good to keep it at the center of the frame using setLocationRelativeTo(null)

@kboulanou
Copy link
Contributor Author

In Windows machines, the click lands on the reduce control of the window, and this causes the windows to be iconified and the test fails.

I have tested with undecorated frames, but the test continues to fail. The test needs to click on the middle of the Windows title bar (Outside of the controls) to pass.

I will set the frames (The background undecorated frame, and the heavyweight component frames) on center as you have suggested.

@prsadhuk
Copy link
Contributor

In Windows machines, the click lands on the reduce control of the window, and this causes the windows to be iconified and the test fails.

WHich test in particular? or is it all tests have this behavior?

The test needs to click on the middle of the Windows title bar (Outside of the controls) to pass.

I tried JMenuBarOverlapping.java but I dont see any click on title bar..The cursor in on top-left of "Test Menu" menu..
If clicking on the title bar is needed to make it gain focus, probably you can try with calling frame.requestFocus and use CountDownLatch with timeout to wait till FOCUS_GAINED event is received and release the latch in focusGained() and then start the test

@myankelev
Copy link
Member

Minor: could you please update the copyright years?

@kboulanou
Copy link
Contributor Author

@prsadhuk I have reviewed the code again and I can point out where we do have the workaround click. It can be found in class SimpleOverlappingTestBase, in method performTest. Following is an excerpt of the source code:

/* this is a workaround for certain jtreg(?) focus issue:
           tests fail starting after failing mixing tests but always pass alone.
         */
        JFrame ancestor = (JFrame)(testedComponent.getTopLevelAncestor());
        if( ancestor != null ) {
            Point ancestorLoc = ancestor.getLocationOnScreen();
            ancestorLoc.translate(isOel7orLater() ? 5 :
                                             ancestor.getWidth() / 2 - 15, 2);
            robot.mouseMove(ancestorLoc.x, ancestorLoc.y);
            Util.waitForIdle(robot);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.delay(50);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Util.waitForIdle(robot);
        }

I will use requestFocus as you have suggested and see if I get tests to pass.

@kboulanou
Copy link
Contributor Author

I will update copyright years for changed classes.

@kboulanou
Copy link
Contributor Author

@prsadhuk after applying your suggested change, I can see that it has fixed the issue for most of the tests but still the following tests didn't pass on Windows compared with the original fix of changing frame width :

java/awt/Mixing/AWT_Mixing/JProgressBarInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JScrollBarInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JSliderInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JTextAreaInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java

I will check why these tests had failed.

@openjdk
Copy link

openjdk bot commented Jul 22, 2025

@kboulanou Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@openjdk
Copy link

openjdk bot commented Sep 4, 2025

@kboulanou
Your change (at version 54087fa) is now ready to be sponsored by a Committer.

…se.java

Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
@openjdk openjdk bot removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated labels Sep 4, 2025

import test.java.awt.regtesthelpers.Util;

/**
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if frameBorderCounter needs to run another java process to get the result. It should be possible to get the same result by running the code in FrameBorderCounter class directly in this JVM. Anyway, it's for another time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not tried this before, I will check this some time and share my findings.

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.

Minor formatting and unneeded imports left.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 23, 2025

@kboulanou 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 issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

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.

7 participants