# HG changeset patch # User tdv # Date 1210781778 25200 # Node ID 0aaf0da3931d2c948b19a96c491e471ca299f901 # Parent 2f69b02943f81ea706d3837aa283cdb83dbfd8fa 6604044: java crashes talking to second X screen Reviewed-by: prr diff -r 2f69b02943f8 -r 0aaf0da3931d jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Tue May 13 16:57:04 2008 -0700 +++ b/jdk/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;