Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8280482: Window transparency bug on Linux #14825

Closed
wants to merge 8 commits into from

Conversation

TejeshR13
Copy link
Contributor

@TejeshR13 TejeshR13 commented Jul 11, 2023

The bug mentions about transparency issue on Linux which actually got resolved with JDK-8006421 fix. Now there is another problem related to the bug, which is screen selection going wrong during checking for new screen when the test is run. The problem is that (As seen in the pictures attached in bug) the transparency is lost for windows which are in screen 0 (default screen) too, which is not supposed to happen where windows on screen 1 should have lost there transparency. The main reason being the call to toGlobal() when window bounds are passed to checkIfOnNewScreen method. I didn't get the actual reason for toGlobal being used here (actually not required to check monitor number), but it actually doubled the X position of the window here. Removing toGlobal solve the issue and neither didn't cause any regression (existing test + the reason toGlobal() was added JDK-8143295).

The automated test fails if GC is changed for windows within screen 0 (default screen). CI testing is green.


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-8280482: Window transparency bug on Linux (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14825

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 11, 2023

👋 Welcome back tr! 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 openjdk bot added the rfr Pull request is ready for review label Jul 11, 2023
@openjdk
Copy link

openjdk bot commented Jul 11, 2023

@TejeshR13 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 Jul 11, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 11, 2023

Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

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

Suggested some minor changes. I ran the changes and test in CI as well, and it passed with a higher repetition test. Test looks fine to me on Linux.

"changed for screen 0");
}
} else if (windowList.get(windowList.size() - 1).getBounds().
intersects(screens[1].getDefaultConfiguration().getBounds())) {
Copy link
Member

Choose a reason for hiding this comment

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

What if user has more than 2 screens?
It looks like the 3rd and subsequent screens are not tested.

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 made the validation as per number of screens now. I guess this is fine to check multiple screens.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why we should be limited to only two when more may be available.
What if it helps to find some issue?
Anyway, the test place windows on all screens, but checking only on two of them.

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 updated the test to available screens (Though not able to test since I can extend to two screens now), I guess it should work, it's generic now.

Copy link
Member

Choose a reason for hiding this comment

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

FYI, you can arrange up to 8 screens using Virtual Box(but I don't think it's necessary in this case)

@TejeshR13
Copy link
Contributor Author

@azvegint @DamonGuy Please let me know if there are any more review suggestions.

@openjdk
Copy link

openjdk bot commented Jul 28, 2023

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

8280482: Window transparency bug on Linux

Reviewed-by: dnguyen, azvegint

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 789 new commits pushed to the master branch:

  • e47a84f: 8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar
  • 78f6799: 8293972: runtime/NMT/NMTInitializationTest.java#default_long-off failed with "Suspiciously long bucket chains in lookup table."
  • 97b6883: 8295059: test/langtools/tools/javap 12 test classes use com.sun.tools.classfile library
  • 3671d83: 8313252: Java_sun_awt_windows_ThemeReader_paintBackground release resources in early returns
  • b60e0ad: 8313207: Remove MetaspaceShared::_has_error_classes
  • 408987e: 8313307: java/util/Formatter/Padding.java fails on some Locales
  • 6fca289: 8313023: Return value corrupted when using CCS + isTrivial (mainline)
  • f8c2b7f: 8313231: Redundant if statement in ZoneInfoFile
  • 807ca2d: 8313316: Disable runtime/ErrorHandling/MachCodeFramesInErrorFile.java on ppc64le
  • ad34be1: 8312525: New test runtime/os/TestTrimNative.java#trimNative is failing: did not see the expected RSS reduction
  • ... and 779 more: https://git.openjdk.org/jdk/compare/17ef8a44a90a74724508a91abda3686e5123d1cd...master

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 Jul 28, 2023
Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

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

LGTM after the changes on my VM

@TejeshR13
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 1, 2023

Going to push as commit 0a3c6d6.
Since your change was applied there have been 793 commits pushed to the master branch:

  • c91a300: 8307312: Replace "int which" with "int cp_index" in constantPool
  • 6af0af5: 8310913: Move ReferencedKeyMap to jdk.internal so it may be shared
  • 86783b9: 8301996: Move field resolution information out of the cpCache
  • 5362ec9: 8312492: Remove THP sanity checks at VM startup
  • e47a84f: 8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar
  • 78f6799: 8293972: runtime/NMT/NMTInitializationTest.java#default_long-off failed with "Suspiciously long bucket chains in lookup table."
  • 97b6883: 8295059: test/langtools/tools/javap 12 test classes use com.sun.tools.classfile library
  • 3671d83: 8313252: Java_sun_awt_windows_ThemeReader_paintBackground release resources in early returns
  • b60e0ad: 8313207: Remove MetaspaceShared::_has_error_classes
  • 408987e: 8313307: java/util/Formatter/Padding.java fails on some Locales
  • ... and 783 more: https://git.openjdk.org/jdk/compare/17ef8a44a90a74724508a91abda3686e5123d1cd...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 1, 2023

@TejeshR13 Pushed as commit 0a3c6d6.

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

Comment on lines +82 to +86
if (screens.length < 2) {
System.out.println("Testing aborted. Required min of 2 screens. " +
"Available : " + screens.length);
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

In such cases, it's better to use jtreg.SkippedException to indicate clearly that the test is not applicable in the current environment.

Comment on lines +130 to +133
@Override
public void mouseClicked(MouseEvent e) {
((Window) e.getSource()).dispose();
}
Copy link
Member

Choose a reason for hiding this comment

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

In the automatic test, it's not necessary at all — you don't expect any input.

Copy link
Member

Choose a reason for hiding this comment

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

Sometimes it's easier to run the test directly, without the jtreg.
Dispose is useful in this case to avoid locking the user's screen.

Copy link
Member

Choose a reason for hiding this comment

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

It's always easier to run the test directly without jtreg.

It was in the original test case, you can dispose of a window by clicking. I see no real problem preserving it. :)

@aivanov-jdk
Copy link
Member

It has fixed the problem, I verified it using the attached reproducer and the automatic test case.

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