提交 1b798d7b 编写于 作者: S serb

8024626: CTW CRASH: SIGSEGV in ctw/jre/lib/rt_jar/preloading_1 and...

8024626: CTW CRASH: SIGSEGV in ctw/jre/lib/rt_jar/preloading_1 and ctw/jre/lib/rt_jar/sun_awt_X11_ListHelper
Reviewed-by: azvegint, alexsch
上级 9469ddaa
......@@ -102,11 +102,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
static TreeMap winMap = new TreeMap();
static HashMap specialPeerMap = new HashMap();
static HashMap winToDispatcher = new HashMap();
private static long _display;
static UIDefaults uidefaults;
static X11GraphicsEnvironment localEnv;
static X11GraphicsDevice device;
static final X11GraphicsConfig config;
static final X11GraphicsEnvironment localEnv;
private static final X11GraphicsDevice device;
private static final X11GraphicsConfig config;
private static final long display;
static int awt_multiclick_time;
static boolean securityWarningEnabled;
......@@ -117,15 +117,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
static {
initSecurityWarning();
if (GraphicsEnvironment.isHeadless()) {
localEnv = null;
device = null;
config = null;
display = 0;
} else {
localEnv = (X11GraphicsEnvironment) GraphicsEnvironment
.getLocalGraphicsEnvironment();
device = (X11GraphicsDevice) localEnv.getDefaultScreenDevice();
config = (X11GraphicsConfig) (device.getDefaultConfiguration());
if (device != null) {
_display = device.getDisplay();
}
config = (X11GraphicsConfig) device.getDefaultConfiguration();
display = device.getDisplay();
setupModifierMap();
initIDs();
setBackingStoreType();
......@@ -196,10 +197,18 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
}
}
static Object displayLock = new Object();
/**
* Returns the X11 Display of the default screen device.
*
* @return X11 Display
* @throws AWTError thrown if local GraphicsEnvironment is null, which
* means we are in the headless environment
*/
public static long getDisplay() {
return _display;
if (localEnv == null) {
throw new AWTError("Local GraphicsEnvironment must not be null");
}
return display;
}
public static long getDefaultRootWindow() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册