Odd error on linux with NewtCanvasAWT
Posted by Agnes on Jul 01, 2012; 10:02pm
URL: https://forum.jogamp.org/Odd-error-on-linux-with-NewtCanvasAWT-tp4025367.html
Hi,
I have the following code that works correctly the first time it is called:
private GLWindow canvas;
private NewtCanvasAWT newtCanvas;
private JFrame frame;
public void show() {
GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
canvas = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(canvas);
frame = new JFrame("A Name");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(960,640);
frame.add(newtCanvas);
frame.setVisible(true);
canvas.addGLEventListener(this);
animator = new Animator(canvas);
animator.add(canvas);
animator.start();
...
}
But the second time it is called, I get this error (the exception is thrown on the frame.setVisible() line):
Warning: NEWT X11 Error: DisplayDispatch 0x7c55da20, Code 0x8, errno Resource temporarily unavailable
Info: NEWT X11 Error: Display 0x7c55da20, Code 0x8, errno Resource temporarily unavailable
Exception in thread "main" java.lang.RuntimeException: Info: NEWT X11 Error: Display 0x7c55da20, Code 0x8, errno Resource temporarily unavailable
at sun.awt.X11.XlibWrapper.XGetWindowProperty(Native Method)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:105)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:76)
at sun.awt.X11.XAtom.getAtomData(XAtom.java:438)
at sun.awt.X11.XWindowPeer.getMWMHints(XWindowPeer.java:1900)
at sun.awt.X11.XWM.setMotifDecor(XWM.java:929)
at sun.awt.X11.XWM.setShellDecor(XWM.java:976)
at sun.awt.X11.XDecoratedPeer.setVisible(XDecoratedPeer.java:1014)
at sun.awt.X11.XFramePeer.setVisible(XFramePeer.java:336)
at sun.awt.X11.XComponentPeer.show(XComponentPeer.java:509)
at java.awt.Component.show(Component.java:1518)
at java.awt.Window.show(Window.java:909)
at java.awt.Component.show(Component.java:1551)
at java.awt.Component.setVisible(Component.java:1503)
at java.awt.Window.setVisible(Window.java:881)
at com.clarke.agnes.benchmark.BenchmarkJoglRunner.show(BenchmarkJoglRunner.java:70)
Where am I going wrong? I am using Ubuntu 12.04 and a pretty recent build of JOGL.