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.

-------------

Commit messages:
 - Merge branch 'master' into JDK-8076313
 - update comments
 - Similar devices logic is broken
 - Update X11GraphicsConfig.java
 - Update X11GraphicsEnvironment.java
 - Drop logging
 - update locking
 - Update X11GraphicsEnvironment.java
 - Merge branch 'JDK-8076313' of https://github.com/mrserb/jdk into JDK-8076313
 - up to date xinerama flag
 - ... and 9 more: https://git.openjdk.java.net/jdk/compare/71bfe962...9e0962f0

Changes: https://git.openjdk.java.net/jdk/pull/2230/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2230&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8076313
  Stats: 345 lines in 6 files changed: 203 ins; 103 del; 39 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2230.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2230/head:pull/2230

PR: https://git.openjdk.java.net/jdk/pull/2230

Reply via email to