if (graphicsConfig != null) {
X11GraphicsConfig parentgc;
// save vis id of current gc
int visual = graphicsConfig.getVisual();
X11GraphicsDevice newDev = (X11GraphicsDevice) GraphicsEnvironment.
getLocalGraphicsEnvironment().
getScreenDevices()[screenNum];
for (int i = 0; i < newDev.getNumConfigs(screenNum); i++) {
if (visual == newDev.getConfigVisualId(i, screenNum)) {
// use that
graphicsConfig = (X11GraphicsConfig)newDev.getConfigurations()[i];
break;
}
}
// just in case...
if (graphicsConfig == null) {