Mac OS X: Add a Toolkit.getDefaultToolkit() incantation to MacOSXSysImplementation to avoid hangs on Mac OS X 10.3

This commit is contained in:
Elias Naur 2007-06-20 08:57:45 +00:00
parent 83ac2f22d0
commit 1e5b712747
2 changed files with 8 additions and 1 deletions

View File

@ -307,7 +307,8 @@
<target name="all" description="Creates the Java archives and the natives for the current platform" depends="jars, compile_native"/>
<!-- Create ONLY the jar archives -->
<target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, generate-all, compile, -createjars">
<target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, compile, -createjars">
<!-- <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, generate-all, compile, -createjars">-->
<move todir="libs/">
<fileset dir="${lwjgl.temp}/jar">
<include name="*.jar"/>

View File

@ -34,6 +34,7 @@ package org.lwjgl;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
import java.awt.Toolkit;
/**
*
@ -42,6 +43,11 @@ import java.security.PrivilegedExceptionAction;
* $Id$
*/
class MacOSXSysImplementation extends J2SESysImplementation {
static {
// Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
Toolkit.getDefaultToolkit();
}
public boolean openURL(String url) {
try {
Method openURL_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {