EVALUATION
I was able to do some debugging (thanks to all those who
offered their systems). Note that you do not need
to setup xinerama in order to reproduce this, a multi-screen
system would do fine.
The problem boils down to the way we check if Xinerama is active.
On solaris we rely on checking if the extension is present,
and then on XineramaGetInfo() function from libXext.so:
(see j2se/src/solaris/native/sun/awt/awt_GraphicsEnv.c)
gotXinExt = XQueryExtension(awt_display, XinExtName, &major_opcode,
&first_event, &first_error);
if (gotXinExt) {
if ((*XineramaSolarisFunc)(awt_display, 0, &fbrects[0],
&fbhints[0], &locNumScr) != 0) {
DTRACE_PRINTLN("Enabling Xinerama support");
usingXinerama = True;
(where XineramaSolarisFunc is dlsym-ed XineramaGetInfo)
Previously on solaris (with Xsun X server) the XINERAMA extension
would only be present when xinerama was active so we would never
even get to call XineramaGetInfo.
With Xorg it appears that the extension is present even when it is not active,
so we proceed to calling libXext's XineramaGetInfo() which
for some reason doesn't return an error but reports success and that
there is a single screen: locNumScr is set to 1.
(this may actually be an Xorg bug, although there may be a requirement
to check if xinerama is active first - but still, the function should
have failed when xinerama is not active).
On this particular system I ran my test on there are two
screens, and xinerama is not enabled, but the extension is present.
So if the default screen is set to be screen 1:
DISPLAY=:0.1
our code assumes that xinerama is enabled, and the number of
screens is 1 (as returned by XineramaGetInfo(). However, the rest
of X calls contradict this, for example, DefaultScreen(dpy)
returns 1, XScreenCount returns 2, etc. Now you can see where
that would be a problem.
In particular, when we try to get the default GraphicsDevice
we get the default screen number by doing downcall to DefaultScreen(dpy)
(which returns 1) and attempt to access screens[1], but since we think
that there's only one screen we get an ArrayOutOfBoundsException.
So I think we should change the way we detect Xinerama.
We may also investigate if the behavior of XineramaGetInfo has changed
recently and if the change was incompatible.
Reassigning to AWT (screen initialization and xinerama detection belongs
to AWT).
|
EVALUATION
one strange thing I see is that AWT is trying to load MToolkit which is not a default toolkit in 6.0 and later.
Do you have MToolkit environment variable set? If so, could you try to unset it and retest. Another question is if the problem is reproducible with java applications such as SwingSet (its location is <java home>/demo/jfc/SwingSet) To run it exec
java -jar SwingSet.jar
Or, if you do use older (1.5) java, please, check the behavior with 1.6
Also it would be nice to verify if the problem is reproducible with java applications such as SwingSet (its location is <java home>/demo/jfc/SwingSet) To run it exec
java -jar SwingSet.jar
I'm marking the CR as incomplete for now (we obviously need more infor ;)
|