--- old/src/solaris/native/sun/java2d/x11/X11SurfaceData.c 2013-02-13 16:01:11.000000000 +0300 +++ new/src/solaris/native/sun/java2d/x11/X11SurfaceData.c 2013-02-13 16:01:10.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,6 @@ static DisposeFunc X11SD_Dispose; static GetPixmapBgFunc X11SD_GetPixmapWithBg; static ReleasePixmapBgFunc X11SD_ReleasePixmapWithBg; -extern int J2DXErrHandler(Display *display, XErrorEvent *xerr); extern AwtGraphicsConfigDataPtr getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this); extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs; @@ -559,10 +558,10 @@ shminfo->readOnly = False; - resetXShmAttachFailed(); - EXEC_WITH_XERROR_HANDLER(J2DXErrHandler, - XShmAttach(awt_display, shminfo)); - + JNIEnv* env = (JNIEnv*)JNU_GetEnv(jvm, JNI_VERSION_1_2); + AWT_LOCK(); + jboolean xShmAttachResult = TryXShmAttach(env, awt_display, shminfo); + AWT_UNLOCK(); /* * Once the XSync round trip has finished then we * can get rid of the id so that this segment does not stick @@ -570,7 +569,7 @@ */ shmctl(shminfo->shmid, IPC_RMID, 0); - if (isXShmAttachFailed() == JNI_TRUE) { + if (xShmAttachResult == JNI_FALSE) { J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment XShmAttach has failed: %s", strerror(errno));