Odd error on linux with NewtCanvasAWT

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Odd error on linux with NewtCanvasAWT

Agnes
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.
Reply | Threaded
Open this post in threaded view
|

Re: Odd error on linux with NewtCanvasAWT

gouessej
Administrator
Hi

It reminds me this case:
http://jogamp.org/wiki/index.php/Tegra2_TrimSlice_running_Ubuntu_natty_using_the_L4T_alpha_driver

Maybe it is a driver bug but we should check that. Please can you provide me a small test case or find an existing one that exhibits this behavior? I will be able to use it on 2 machines with GNU Linux and Nvidia graphics cards.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Odd error on linux with NewtCanvasAWT

Sven Gothel
Administrator
In reply to this post by Agnes
On 07/02/2012 12:02 AM, Agnes [via jogamp] wrote:

> 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();
>         ...
> }
Dear Agnes,

can you pls provide a complete test case ?
Also pls provide more information as described in our Wiki (-> FAQ/Bugreport),
you can also search the forum for 'bugreport' if you feel unsure.

Thank you ..

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Odd error on linux with NewtCanvasAWT

Agnes
I will provide a full test case - but probably won't have a chance to do so before the weekend. I hope it is possible to reuse an instance of a newtcanvas as the code works OK the first time... I will try that as well.
Reply | Threaded
Open this post in threaded view
|

Re: Odd error on linux with NewtCanvasAWT

Sven Gothel
Administrator
On 07/02/2012 06:47 PM, Agnes [via jogamp] wrote:
> I will provide a full test case - but probably won't have a chance to do so
> before the weekend. I hope it is possible to reuse an instance of a newtcanvas
> as the code works OK the first time... I will try that as well.

Thank you.

Since we already have lots of test cases in our repository,
it would be best to browse through them for a while and
maybe use a similar one for your purpose, copy it to a new named class and
patch it. This may even give us insight why we don't handle your use case.

~Sven


signature.asc (910 bytes) Download Attachment