提交 46d54ef2 编写于 作者: L leonidr

7181027: [macosx] Unable to use headless mode

Reviewed-by: anthony
上级 ea0c084e
......@@ -170,12 +170,12 @@ public abstract class GraphicsEnvironment {
if (System.getProperty("javaplugin.version") != null) {
headless = defaultHeadless = Boolean.FALSE;
} else {
if ("sun.awt.HeadlessGraphicsEnvironment".equals(
System.getProperty("java.awt.graphicsenv")))
String osName = System.getProperty("os.name");
if (osName.contains("OS X") && "sun.awt.HToolkit".equals(
System.getProperty("awt.toolkit")))
{
headless = defaultHeadless = Boolean.TRUE;
} else {
String osName = System.getProperty("os.name");
headless = defaultHeadless =
Boolean.valueOf(("Linux".equals(osName) ||
"SunOS".equals(osName) ||
......
......@@ -398,6 +398,7 @@ GetJavaProperties(JNIEnv *env)
PreferredToolkit prefToolkit = getPreferredToolkit();
switch (prefToolkit) {
case CToolkit:
case HToolkit:
sprops.graphics_env = "sun.awt.CGraphicsEnvironment";
break;
case XToolkit:
......@@ -405,9 +406,6 @@ GetJavaProperties(JNIEnv *env)
sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
#ifdef MACOSX
break;
default:
sprops.graphics_env = "sun.java2d.HeadlessGraphicsEnvironment";
break;
}
#endif
/* AWT properties */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册