Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6636469
Votes 3
Synopsis Java Fullscreen Exclusive Mode not working with Xorg server 1.3.0 and above
Category java:classes_2d
Reported Against
Release Fixed 7(b28), 6-open(b10) (Bug ID:2162466)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6599351
Submit Date 03-DEC-2007
Description
FULL PRODUCT VERSION :
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

Problem not fixed yet as of java 1.7.0 b23

ADDITIONAL OS VERSION INFORMATION :
I came across this problem in Ubuntu 7.10 (Gutsy) but having checked the upstream code of both X and Java I believe it may be present in any Unix/Linux OS shipping a version of Xorg Server 1.3.0 or above with Xrandr 1.2

A DESCRIPTION OF THE PROBLEM :
I've discovered a problem caused by a change in Xorg server 1.3.0 (and above) which prevents use of Full Screen Exclusive mode (FSEM).

As of Xorg server 1.3 the Xinerama backend implementation has been replaced with a fake one provided by Xrandr 1.2. If the real Xinerama is not compiled in (by default it's not) it registers itself as the "XINERAMA" extension and handles the Xinerama protocol calls[2].

Unfortunately this has changed the interface slightly; the real Xinerama
would not initialise if there is only 1 monitor [3], but the Xrandr one
now does [4].

  From studying the IcedTea/OpenJDK code [5] I see the Java native calls
that setup FSEM use Xrandr. However if Xinerama is active they rightly
avoid using Xrandr and therefore disable FSEM [6].

Because Xinerama now appears to be loaded even for single monitor setups
it seems FSEM is not possible.

I discussed this problem on #xorg and was advised that if calling XRRQueryVersion() returns >= 1.2, Java should go ahead and use Xrandr even if Xinerama does appear present. I'm happy to code up a patch to do this and will attach here and or submit to the awt-dev mailing list.

[1] https://lists.ubuntu.com/archives/ubuntu-x/2007-November/000061.html
[2] http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=blob;f=randr/rrxinerama.c
[3] See PanoramiXExtensionInit(...) in http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=blob;f=Xext/panoramiX.c
[4] See RRXineramaExtensionInit(void) in [2]
[5] https://openjdk.dev.java.net/source/browse/openjdk/jdk/tags/jdk7-b23/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c?view=markup
[6] See Java_sun_awt_X11GraphicsDevice_initXrandrExtension() in [5]

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Install any recent Linux distro that ships xorg server 1.3+, for instance Ubuntu Gutsy Gibbon 7.10 onto a system with only a single monitor attached.

2) Run the following command

    xdpyinfo | grep XINERAMA

Note no output on pre xorg-server 1.3 installations (e.g Ubuntu Feisty) which indicates Xinerama not loaded/active, but on an xorg-server 1.3 installation:

    XINERAMA

which indicates Xinerama is in the list of active X server extensions.

3) Install Java 6 or 7

4) Run QueryFSEM.java (attached in Test Case section below) compare with Expected and Actual Result sections below.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
GRAPHICS DEVICE:

  isFullScreenSupported: true

DISPLAY MODES:

  1: 1440 x 900 @ 60Hz -1bit
  2: 1024 x 768 @ 60Hz -1bit
... list of display modes continues

ACTUAL -
GRAPHICS DEVICE:

  isFullScreenSupported: false

DISPLAY MODES:

  1: 1440 x 900 @ 60Hz -1bit

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public static void main(String[] args) {
	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
	GraphicsDevice gd = ge.getDefaultScreenDevice();
	DisplayMode[] dms = gd.getDisplayModes();
	
	System.out.println("GRAPHICS DEVICE:\n");
	System.out.println("  isFullScreenSupported: " + gd.isFullScreenSupported() + "\n");
	
	System.out.println("DISPLAY MODES:\n");
	DisplayMode dm = null;
	for (int i = 0; i < dms.length; i++) {
		dm = dms[i];
		System.out.printf("%3d: %4d x%4d @ %dHz %dbit\n",
			i+1, dm.getWidth(), dm.getHeight(),
			dm.getRefreshRate(), dm.getBitDepth());
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None as yet.

The old xorg.conf ServerFlags option "Xinerama" can no longer be used to disable the fake Xinerama as the code that checks this flag is conditionally compiled-in with Xinerama itself. The real Xinerama doesn't appear to be compiled in by default in Ubuntu's X server.
Posted Date : 2007-12-03 10:09:29.0
Work Around
N/A
Evaluation
This bug is related to
  6599351: javaws only runs in the left-hand screen on snv_71
which is caused by the way we detect Xinerama. But as the submitter
pointed out we may also relax the conditions for using randr when
xinerama is present.
Posted Date : 2007-12-03 15:56:15.0

The fix was proposed by the member of the community (munkfish).
See this thread for more information:
http://mail.openjdk.java.net/pipermail/2d-dev/2008-May/000272.html
http://www.nabble.com/-PATCH--6636469%3A-Java-Fullscreen-Exclusive-Mode-not-working-with%09Xorg-server-1.3.0-and-above-to14228454.html
Posted Date : 2008-05-13 20:49:15.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang