diff options
author | Sven Gothel <[email protected]> | 2014-02-26 17:04:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-02-26 17:04:03 +0100 |
commit | 80a0ddd084e674fbfff007e6a83eec6162aaa32d (patch) | |
tree | 10ae3efcd51e174997943f40a5ea8c9bd39a8b75 /src/nativewindow | |
parent | d84812b6fb398c73cb3f339ab13d74b7e6822181 (diff) | |
parent | 72d44215a266ccb569efbd5af3142385c4442fe9 (diff) |
Merge branch 'master' into 2.2-train
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 5 | ||||
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index 20ab7a2ee..bb7b44795 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -432,7 +432,10 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, public final boolean hideCursor() { AWTEDTExecutor.singleton.invoke(false, new Runnable() { public void run() { - component.setCursor(AWTMisc.getNullCursor()); + final Cursor cursor = AWTMisc.getNullCursor(); + if( null != cursor ) { + component.setCursor(cursor); + } } } ); return true; } diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java index 069cffeb8..3099f293d 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java +++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java @@ -50,6 +50,8 @@ import javax.media.nativewindow.util.PixelFormat; import javax.media.nativewindow.util.PixelFormatUtil; import javax.swing.MenuSelectionManager; +import jogamp.nativewindow.jawt.JAWTUtil; + public class AWTMisc { public static JFrame getJFrame(Component c) { @@ -174,9 +176,18 @@ public class AWTMisc { static final HashMap<Integer, Cursor> cursorMap = new HashMap<Integer, Cursor>(); static final Cursor nulCursor; static { - final Toolkit toolkit = Toolkit.getDefaultToolkit(); - final BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR); - nulCursor = toolkit.createCustomCursor(img, new Point(0,0), "nullCursor"); + Cursor _nulCursor = null; + try { + final Toolkit toolkit = Toolkit.getDefaultToolkit(); + final BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR); + _nulCursor = toolkit.createCustomCursor(img, new Point(0,0), "nullCursor"); + } catch (Exception he) { + if( JAWTUtil.DEBUG ) { + System.err.println("Catched exception: "+he.getMessage()); + he.printStackTrace(); + } + } + nulCursor = _nulCursor; } public static synchronized Cursor getNullCursor() { return nulCursor; } |