changeset 307:ed68352f7e42

6604044: java crashes talking to second X screen Reviewed-by: prr
author tdv
date Wed, 14 May 2008 09:16:18 -0700
parents be7daefad89f
children 4af4867ed787
files src/solaris/native/sun/awt/awt_GraphicsEnv.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Tue May 13 16:57:04 2008 -0700
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed May 14 09:16:18 2008 -0700
@@ -650,7 +650,7 @@
         if (XineramaQueryScreens != NULL) {
             DTRACE_PRINTLN("calling XineramaQueryScreens func on Linux");
             xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr);
-            if (xinInfo != NULL) {
+            if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) {
                 int32_t idx;
                 DTRACE_PRINTLN("Enabling Xinerama support");
                 usingXinerama = True;
@@ -701,7 +701,8 @@
         if (XineramaSolarisFunc != NULL) {
             DTRACE_PRINTLN("calling XineramaGetInfo func on Solaris");
             if ((*XineramaSolarisFunc)(awt_display, 0, &fbrects[0],
-                                       &fbhints[0], &locNumScr) != 0)
+                                       &fbhints[0], &locNumScr) != 0 &&
+                locNumScr > XScreenCount(awt_display))
             {
                 DTRACE_PRINTLN("Enabling Xinerama support");
                 usingXinerama = True;