summaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index 6f3c95570..748604994 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -39,6 +39,8 @@ import javax.media.nativewindow.GraphicsConfigurationFactory;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.MutableSurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.OffscreenLayerSurface;
import javax.media.nativewindow.VisualIDHolder;
import javax.media.nativewindow.util.Insets;
import javax.media.nativewindow.util.Point;
@@ -403,7 +405,23 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
throw new RuntimeException("Failed: "+pi+", "+WindowDriver.this);
}
} } );
- } // else may need offscreen solution ? FIXME
+ } else {
+ final OffscreenLayerSurface ols = NativeWindowFactory.getOffscreenLayerSurface(this, true);
+ if( null != ols ) {
+ try {
+ setOLSPointer(ols, pi);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ private static void setOLSPointer(final OffscreenLayerSurface ols, final PointerIconImpl pi) throws Exception {
+ if( null != pi ) {
+ ols.setCursor(pi.getResource(), pi.getHotspot());
+ } else {
+ ols.setCursor(null, null); // default
+ }
}
@Override
@@ -417,7 +435,21 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
} } );
return true; // setPointerVisible0 always returns true ..
- } // else may need offscreen solution ? FIXME
+ } else {
+ final OffscreenLayerSurface ols = NativeWindowFactory.getOffscreenLayerSurface(this, true);
+ if( null != ols ) {
+ try {
+ if( pointerVisible ) {
+ setOLSPointer(ols, (PointerIconImpl)getPointerIcon());
+ } else {
+ ols.hideCursor();
+ }
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
return false;
}