-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8252133: The java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java fails if metal pipeline is active #554
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
Conversation
/cc lanai |
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
@mrserb The label
|
/cc 2d |
/label remove awt |
@mrserb |
@mrserb |
Webrevs
|
Make sure the main display is in the list of all displays. Prevent duplicate main screen if the switch has happened.
@mrserb 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 164 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 |
: new CGraphicsDevice(id)); | ||
} | ||
// fetch the main display again, the old value might be outdated | ||
mainDisplayID = getMainDisplayID(); |
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 action since line 162 can trigger changing the getMainDisplayID() outcome?
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.
If the main screen is not in the list of screens means that the system monitors were changed in some way after this method was called and we will get one more notification later.
/integrate |
@mrserb Since your change was applied there have been 199 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit e5870cf. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This bug easily reproduced by the test in question on the dual video card systems
when the metal pipeline is active. But it is possible to reproduce it in the OGL
pipeline as well, but it is required some additional steps.
Problem description:
Our CGraphicsEnvironment maintains the list of active graphics devices. The one
important feature of this CGraphicsEnvironment is to invalidate the old devices and
map them to the new devices. For example, if the user got a reference to the device,
and this device was removed then this reference will refer to the main screen.
The problem in the current implementation arise when the system has two video cards:
1 The user get some GraphicsDevice
2 The user sets the full-screen window for this device
3 The user change screen resolution for this device
4 The resolution of the screen is not changed ->> BUG.
The problem is that somewhere after step 1 or 2 and before step 3 the macOS decided
to switch to the discrete video card, but it does not report the old device(integrated VC)
as removed, because actually no screens were removed.
Since it was not reported as removed we did not invalidate it and did not map it to the
new device ->> request to change the screen resolution at step 3 send to some non existed
deviceID.
As a fix I suggest to change this current logic:
To this logic:
The old review request:
https://mail.openjdk.java.net/pipermail/2d-dev/2020-August/011011.html
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/554/head:pull/554
$ git checkout pull/554