jogl on dual monitor setup

I’m using the InfoNode docking window framework to contain a jogl GLCanvas and a JTextArea in a split window. When I run the application and toggle the adjacent JTextArea to be visible or hidden, everything works. However If I move the main frame to the other monitor from which it was created in when it was launched, when I make the adjacent JTextArea hidden I get the following exception.

Is there something that I must do at startup to allow the application to use the seconds monitors desktop space.

John

I’m not sure but this sounds like something you should ask on the Swing / AWT forum on javadesktop.org.

I posted over there and Artem Ananiev asked me to post a small test case that reproduced the problem. In doing this I found that its not all heavyweight components that cause the problem. I tried the JMF media player heavyweight component and there is no problem. Only the jogl GLCanvas gives an exception.

I’ve attached the test code demo.java if you can try it and see if it is reproducible. You’ll need the following:

Then go to line 282 and put the correct path to the lung01a.mov file, or any other file that you will use. Now you can compile and run.


javac -cp idw-gpl.jar:jogl.jar:mediaplayer.jar:multiplayer.jar:jmf.jar demo.java 
java -Djava.library.path=/path/to/jogl/native/libs -cp idw-gpl.jar:.:jogl.jar:gluegen-rt.jar:mediaplayer.jar:multiplayer.jar:jmf.jar demo

Using the menus you can toggle the visibility of the JMF component. In either monitor there is no problem. If you go to line 280-282 and replace the JMF component with the GLCanvas you will get an exception when toggling the visibility in the second monitor.

John

I don’t think you mentioned this but what OS are you seeing the problem on?

It would be helpful if you would simplify this even more. The JMF / GLCanvas comparison seems unnecessary; you could just compare the behavior of Canvas to GLCanvas.

To be honest I don’t think I have a dual monitor setup to test this on, so you may not see any action on this in the near future. It would be most helpful if you would consider building JOGL and investigating the behavior in the JOGL source code. It isn’t that complex (see for example WindowsGLContext.java, WindowsGLDrawable.java, WindowsOnscreenGLDrawable.java, WindowsOnscreenGLContext.java).

[quote]I don’t think you mentioned this but what OS are you seeing the problem on?
[/quote]
I’m using fedora core 6.

I tried the Canvas instead and that is fine. Only the GLCanvas gives the exception.

I’ll look into the jogl source now.

John

I don’t know the nitty-gritty details of opengl, but does it allow for contexts to span multiple monitors and devices? If it doesn’t, then that would be your problem.

The problem seems to be that to close and restore the docking frame in which I house the GLCanvas, the InfoNode docking package removes and adds the component. It is during this activity that I get the exception of adding a container to a container on a different GraphicsDevice. I have enabled debugging in jogl (jogl.debug) and see that it is after the GLCanvas context has been removed and a removeNotify() (I think that is the name) and before the addNotify() that I get the exception.

I’m having some problem narrowing it down, so I might just workaround it and enable a different method that does not actually remove and add the canvas. I have some preliminary results that indicate that I will not get the exception, and still have the canvas spanning the two monitors.

John