diff options
Diffstat (limited to 'src/nativewindow/classes/javax/media')
3 files changed, 10 insertions, 7 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java index 83b437612..fa25c214f 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java @@ -110,14 +110,15 @@ public interface AbstractGraphicsDevice extends Cloneable { public void unlock(); /** - * Optionally closing the device.<br> - * The default implementation is a NOP operation, returning false.<br> + * Optionally closing the device. + * <p> + * The default implementation is a <code>NOP</code>, just setting the handle to <code>null</code>. + * </p> * The specific implementing, ie {@link javax.media.nativewindow.x11.X11GraphicsDevice}, * shall have a enable/disable like {@link javax.media.nativewindow.x11.X11GraphicsDevice#setCloseDisplay(boolean, boolean)},<br> * which shall be invoked at creation time to determine ownership/role of freeing the resource.<br> * - * @return true if a specialized closing operation was successfully issued, otherwise false, - * ie no native closing operation was issued, which doesn't imply an error at all. + * @return true if the handle was not <code>null</code>, otherwise false. */ public boolean close(); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java index 331167244..187959a67 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java @@ -140,6 +140,10 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice } public boolean close() { + if(0 != handle) { + handle = 0; + return true; + } return false; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java index ac4aacec7..73c8cfd52 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java @@ -96,10 +96,8 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl System.err.println(Thread.currentThread().getName() + " - X11GraphicsDevice.close(): "+this); } X11Util.closeDisplay(handle); - handle = 0; - return true; } - return false; + return super.close(); } } |