JDK-6702458 : 6u10 support for translucent windows doesn't check for XRENDER extension before using it.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-05-14
  • Updated: 2011-01-19
  • Resolved: 2008-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b26Fixed
Related Reports
Relates :  
Description
The fix for 6633275 (translucent and shaped windows) introduces use of the XRENDER
extension in awt_GraphicsEnv.c After loading the library, the code starts making
calls, but doesn't first check if the extension is in fact supported.

On at least some versions of Xlib this is obvious because you get a ton of messages :
Xlib:  extension "RENDER" missing on display "myhost:0.0"
Xlib:  extension "RENDER" missing on display "myhost:0.0".
Xlib:  extension "RENDER" missing on display "myhost:0.0".
....

Comments
SUGGESTED FIX --- old/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2008-05-20 15:52:08.000000000 +0400 +++ new/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2008-05-20 15:52:08.000000000 +0400 @@ -395,6 +395,7 @@ int xinawareScreen; void* xrenderLibHandle = NULL; XRenderFindVisualFormatFunc *XRenderFindVisualFormat = NULL; + int major_opcode, first_event, first_error; if (usingXinerama) { @@ -478,20 +479,24 @@ graphicsConfigs[0] = defaultConfig; nConfig = 1; /* reserve index 0 for default config */ - - xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); + // Only use the RENDER extension if it is available on the X server + if (XQueryExtension(awt_display, "RENDER", + &major_opcode, &first_event, &first_error)) + { + xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); #ifndef __linux__ /* SOLARIS */ - if (xrenderLibHandle == NULL) { - xrenderLibHandle = dlopen("/usr/sfw/lib/libXrender.so.1", - RTLD_LAZY | RTLD_GLOBAL); - } + if (xrenderLibHandle == NULL) { + xrenderLibHandle = dlopen("/usr/sfw/lib/libXrender.so.1", + RTLD_LAZY | RTLD_GLOBAL); + } #endif - if (xrenderLibHandle != NULL) { - XRenderFindVisualFormat = - (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle, - "XRenderFindVisualFormat"); + if (xrenderLibHandle != NULL) { + XRenderFindVisualFormat = + (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle, + "XRenderFindVisualFormat"); + } } for (i = 0; i < nTrue; i++) {
16-05-2008

EVALUATION Should call XQueryExtension() before using the RENDER extension.
16-05-2008