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

8076313: GraphicsEnvironment does not detect changes in count of monitors on Linux OS #2230

Closed
wants to merge 19 commits into from

Conversation

mrserb
Copy link
Member

@mrserb mrserb commented Jan 26, 2021

This fix enables display change detection on Linux when the number of monitors is changed in the Xinerama mode.

The fix itself is straightforward:

  1. When we get an event that the root window is changed we assume that it could be caused by some screen manipulation like screen resolution change or adding/removing a monitor.
  2. We rebuild the native data structure for the x11 screens, and then mirror this data on the java level in the X11GraphicsEnvironment.
  3. While we updating the data, we block all access to it in the native -> after the fix all access to the native x11 screens should be done under awt-lock.

Notes:

  • This fix has a long chain of pre-fixes where we dropped the native access to the x11 screens, to minimize the places we need to synchronize.
  • In the current version we rebuild the screens more often than needed, for example, we rebuild it even if resolution changed in a single monitor config. It is done intentionally to increase the test code coverage for now.
  • The current implementation is based on the Xinerama, while the better solution will be use XRandr 1.5, but it does not support AIX, and is not supported in the current devkit.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8076313: GraphicsEnvironment does not detect changes in count of monitors on Linux OS

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2230/head:pull/2230
$ git checkout pull/2230

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 26, 2021

👋 Welcome back serb! 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 Jan 26, 2021

⚠️ @mrserb This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk
Copy link

openjdk bot commented Jan 26, 2021

@mrserb The following label will be automatically applied to this pull request:

  • awt

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 awt client-libs-dev@openjdk.org label Jan 26, 2021
@mrserb mrserb marked this pull request as ready for review January 26, 2021 04:22
@mrserb mrserb marked this pull request as draft January 26, 2021 04:22
@@ -105,6 +110,25 @@ public int getType() {
return TYPE_RASTER_SCREEN;
}

public int scaleUp(int x) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is copied not moved from the X11GraphicsConfig, just to minimize the change in the fix. I Will clean up this later.

@mrserb mrserb marked this pull request as ready for review January 31, 2021 01:26
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 31, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 31, 2021

Webrevs

Copy link
Member

@azuev-java azuev-java left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Feb 2, 2021

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

8076313: GraphicsEnvironment does not detect changes in count of monitors on Linux OS

Reviewed-by: kizune

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

  • 288a4fe: 8260643: Remove parallel version handling in CardTableRS::younger_refs_in_space_iterate()
  • ddd2951: 8260571: Add PrintMetaspaceStatistics to print metaspace statistics upon VM exit
  • fe407cf: 8260420: C2 compilation fails with assert(found_sfpt) failed: no node in loop that's not input to safepoint
  • 474dba2: 8257086: Clarify differences between {Float, Double}.equals and ==
  • 54e7a64: 8260576: Typo in compiler/runtime/safepoints/TestRegisterRestoring.java
  • a6d9505: 8260864: ProblemList two security/krb5 tests on Linux
  • 9880c4c: 8260860: ProblemList tools/jlink/plugins/CompressorPluginTest.java
  • 55d62a5: 8213226: [TESTBUG] Reduce the usage of CDSTestUtils.executeAndLog()
  • b6a7367: 8260349: Cannot programmatically retrieve Metaspace max set via JAVA_TOOL_OPTIONS
  • 50f9a70: 8217327: G1 Post-Cleanup region liveness printing should not print out-of-date efficiency
  • ... and 18 more: https://git.openjdk.java.net/jdk/compare/71bfe962ebcf46537d4624e5ddf36003365fbb84...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 Feb 2, 2021
@mrserb
Copy link
Member Author

mrserb commented Feb 3, 2021

/integrate

@openjdk openjdk bot closed this Feb 3, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 3, 2021
@openjdk
Copy link

openjdk bot commented Feb 3, 2021

@mrserb Since your change was applied there have been 42 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 98a7692.

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

@mrserb mrserb deleted the JDK-8076313 branch April 12, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awt client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants