27 lines
1.5 KiB
Diff
27 lines
1.5 KiB
Diff
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
|
|
index 6ad777e8ca..d7be507bda 100644
|
|
--- a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
|
|
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
|
|
@@ -449,7 +449,20 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|
if (!doEraseBackground()) {
|
|
return;
|
|
}
|
|
- int pixel = surfaceData.pixelFor(c.getRGB());
|
|
+ int pixel = 0;
|
|
+ boolean isOglEnabled = Boolean.getBoolean("sun.java2d.opengl");
|
|
+ if (isOglEnabled) {
|
|
+ // 6304250: XAWT: Items in choice show a blue border on OpenGL + Solaris10 when background color is set
|
|
+ // Note: When OGL is enabled, surfaceData.pixelFor() will not
|
|
+ // return a pixel value appropriate for passing to
|
|
+ // XSetWindowBackground(). Therefore, we will use the ColorModel
|
|
+ // for this component in order to calculate a pixel value from
|
|
+ // the given RGB value.
|
|
+ ColorModel cm = getColorModel();
|
|
+ pixel = PixelConverter.instance.rgbToPixel(c.getRGB(), cm);
|
|
+ } else {
|
|
+ pixel = surfaceData.pixelFor(c.getRGB());
|
|
+ }
|
|
XlibWrapper.XSetWindowBackground(XToolkit.getDisplay(), getContentWindow(), pixel);
|
|
XlibWrapper.XClearWindow(XToolkit.getDisplay(), getContentWindow());
|
|
}
|