-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
👋 Welcome back tr! A progress list of the required criteria for merging this PR into |
@TejeshR13 The following label will be automatically applied to this pull request:
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. |
Webrevs
|
There was a problem hiding this 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.
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
"changed for screen 0"); | ||
} | ||
} else if (windowList.get(windowList.size() - 1).getBounds(). | ||
intersects(screens[1].getDefaultConfiguration().getBounds())) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/Multiscreen/MultiScreenCheckScreenIDTest.java
Outdated
Show resolved
Hide resolved
@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:
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
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 |
There was a problem hiding this 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
/integrate |
Going to push as commit 0a3c6d6.
Your commit was automatically rebased without conflicts. |
@TejeshR13 Pushed as commit 0a3c6d6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
if (screens.length < 2) { | ||
System.out.println("Testing aborted. Required min of 2 screens. " + | ||
"Available : " + screens.length); | ||
return; | ||
} |
There was a problem hiding this comment.
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.
@Override | ||
public void mouseClicked(MouseEvent e) { | ||
((Window) e.getSource()).dispose(); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :)
It has fixed the problem, I verified it using the attached reproducer and the automatic test case. |
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 tocheckIfOnNewScreen
method. I didn't get the actual reason fortoGlobal
being used here (actually not required to check monitor number), but it actually doubled the X position of the window here. RemovingtoGlobal
solve the issue and neither didn't cause any regression (existing test + the reasontoGlobal()
was added JDK-8143295).The automated test fails if GC is changed for windows within screen 0 (default screen). CI testing is green.
Progress
Issue
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