-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8354415: [Ubuntu25.04] api/java_awt/GraphicsDevice/indexTGF.html#SetDisplayMode - setDisplayMode_REFRESH_RATE_UNKNOWN fails: Height is different on vnc #26268
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
👋 Welcome back azvegint! A progress list of the required criteria for merging this PR into |
@azvegint 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 27 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 |
|
It is a TigerVNC with a virtual Xtigervnc server (no physical display is connected). |
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.
Fix LGTM.
It works as expected on VNC host. No regressions observed with existing java/awt/FullScreen tests on VNC host and on local.
@@ -62,4 +62,11 @@ struct X11GraphicsConfigIDs { | |||
jfieldID bitsPerPixel; | |||
}; | |||
|
|||
#define MAX_DISPLAY_MODES 256 |
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.
File requires copyright year update
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 can be handled as a batch copyright year update.
Seems reasonable. The only strange thing is that passing boolean parameter, immediately negating it and use the new value everywhere. But that's Ok if it increase the code readability which i think it does. |
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.
/integrate
@@ -62,4 +62,11 @@ struct X11GraphicsConfigIDs { | |||
jfieldID bitsPerPixel; | |||
}; | |||
|
|||
#define MAX_DISPLAY_MODES 256 |
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 can be handled as a batch copyright year update.
Going to push as commit 18c2e40.
Your commit was automatically rebased without conflicts. |
xrandrExtSupported = | ||
Boolean.valueOf(initXrandrExtension()); | ||
boolean useOldConfigDisplayMode = | ||
Boolean.getBoolean("awt.x11useOldConfigDisplayMode"); |
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 guess the idea of this property is to share it to the ppl as a workaround in case some errors will occur? Then the CSR might be needed for it. The better name might be: "awt.x11.EnableXrandrDisplayModes"=true.
|
||
static jint refreshRateFromModeInfo(const XRRModeInfo *modeInfo) { | ||
if (!modeInfo->hTotal || !modeInfo->vTotal) { | ||
return 0; |
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 should be REFRESH_RATE_UNKNOWN?
Bool matchW = (isLandscape ? mode.width : mode.height) == (unsigned int) width; | ||
Bool matchH = (isLandscape ? mode.height : mode.width) == (unsigned int) height; | ||
|
||
if (matchW && matchH && rr == refreshRate) { |
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.
do we need to stop on the first mode we found or we should select the nearest refrate to the int? or maybe select the largest one? like 59.7 vs 59.9 vs 60?
Additionally to the comments above I think some test should be updated to touch both cases when the new property is set and not. |
On Linux, we are currently use XRRSetScreenConfigAndRate to change the display mode. This works in most cases, except for some VNC-configured hosts, where the display change may not occur.
One of the conformance tests fails on these hosts.
It was discovered, that the xrandr utility app works fine on these hosts and uses the Crtc and Output Randr APIs, which provide more fine-grained control over display settings.
This changeset utilizes the Crtc and Output Randr APIs to change the display mode.
Currently, changing the display mode is only available when running a single screen.
This limitation remains, but we may remove it in the future. A separate issue has been filed for this purpose.
The
awt.x11useOldConfigDisplayMode
system property enables the old behavior. Perhaps there's a better name for it.Testing looks good on VNC and local machines.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26268/head:pull/26268
$ git checkout pull/26268
Update a local copy of the PR:
$ git checkout pull/26268
$ git pull https://git.openjdk.org/jdk.git pull/26268/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26268
View PR using the GUI difftool:
$ git pr show -t 26268
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26268.diff
Using Webrev
Link to Webrev Comment