From b9c965ff0bd6944f06ac465d31e6d851ad7ed1d0 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 10 Jul 2006 18:03:38 +0000 Subject: [PATCH] Windows: Add System.loadLibrary("jawt") again, since it seems that Toolkit.getDefaultToolkit() is not always enough. --- .../lwjgl/opengl/Win32CanvasImplementation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java b/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java index b92b1a1f..afc201d7 100644 --- a/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java +++ b/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java @@ -38,6 +38,7 @@ import java.security.PrivilegedAction; import java.security.AccessController; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; /** * @@ -49,6 +50,19 @@ final class Win32CanvasImplementation implements AWTCanvasImplementation { static { // Make sure the awt stuff is properly initialised (the jawt library in particular) Toolkit.getDefaultToolkit(); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + System.loadLibrary("jawt"); + } catch (UnsatisfiedLinkError e) { + /* It is probably already loaded, potentially by a different ClassLoader + * so just log the exception and continue + */ + LWJGLUtil.log("Failed to load jawt: " + e.getMessage()); + } + return null; + } + }); } public PeerInfo createPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format) throws LWJGLException {