NewtCanvasAWT resize bug

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

NewtCanvasAWT resize bug

Job Zwiers
I noticed that after resizing a NewtCanvasAWT Canvas to height = zero, the application cannot be terminated anymore without using the Windows 7 task manager. I checked this with builds 785, 636, 571. With an older build (417, august 2011) everything works fine. Also, I did not notice any problem with Newt without using NewtCanvasAWT. Any ideas?

The code for a minimal test case:

public class SwingNEWTBug implements   GLEventListener {
   public SwingNEWTBug() {          
     GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
     NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
     glWindow.addGLEventListener(this);
     JFrame jFrame = new JFrame("Resize BUG");
     jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     jFrame.add(newtCanvasAWT);
     jFrame.setSize(640, 480);
     jFrame.setVisible(true);
   }
   public void init(GLAutoDrawable drawable) { }  
   public void dispose(GLAutoDrawable drawable) { }
   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
   public void display(GLAutoDrawable drawable) { }
   public static void main(String[] arg) {  new SwingNEWTBug();  }
}
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize bug

gouessej
Administrator
Hi

Thank you for reporting that. Could you try to build GlueGen and JOGL from source and to find which revision causes this regression please?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize bug

Sven Gothel
Administrator
In reply to this post by Job Zwiers
On 07/26/2012 05:43 PM, Job Zwiers [via jogamp] wrote:
> I noticed that after resizing a NewtCanvasAWT Canvas to height = zero, the
> application cannot be terminated anymore without using the Windows 7 task
> manager. I checked this with builds 785, 636, 571. With an older build (417,
> august 2011) everything works fine.

We sure handle a zero sized component (NEWT, NewtCanvasAWT)
as a non realized drawable - at creation time.
Good that you report this behavior, since I haven't validated
the resize to zero behavior with an already realized drawable.
Problem: On some platforms a zero drawable surface is invalid.

Can you describe your test case a bit more in detail ?
I assume you setup an arbitrary NewtCanvasAWT as shown in your snippet
and _manually_ attempt to resize it to zero ?
Can you attach a log file w/ all debug flags enabled ?
(See wiki page .. -Djogl.debug=all -Dnewt.debug=all -Dnativewindow.debug=all;
redirect stdout/stderr to one file [bash test.sh > a.log 2>&1] and attach it)

> Also, I did not notice any problem with
> Newt without using NewtCanvasAWT.
That reduces the error space, thx. Still, we have to
validate our behavior here as well.

> Any ideas?

Guess we are working on this together here.

~Sven


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

Re: NewtCanvasAWT resize bug

Job Zwiers
In reply to this post by gouessej
gouessej wrote
Hi

Thank you for reporting that. Could you try to build GlueGen and JOGL from source and to find which revision causes this regression please?
Ok, wel,l why should I rebuild from source? From the autobuilds I figured that Jogl build 544 from 27/10 is still ok, but 545 from 20/11 starts to fail.

Job
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize bug

gouessej
Administrator
Thank you Job. I agree with Sven, there is no trivial way of fixing that as a drawable with a size equal to zero is considered invalid on some platforms.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize bug

Job Zwiers
In reply to this post by Sven Gothel
Sven Gothel wrote
On 07/26/2012 05:43 PM, Job Zwiers [via jogamp] wrote:

We sure handle a zero sized component (NEWT, NewtCanvasAWT)
as a non realized drawable - at creation time.
Good that you report this behavior, since I haven't validated
the resize to zero behavior with an already realized drawable.
Problem: On some platforms a zero drawable surface is invalid.
Ok, but the bug appears also when, after temporarlity resizing to zero, I later on resize back to normal.

Can you describe your test case a bit more in detail ?
I assume you setup an arbitrary NewtCanvasAWT as shown in your snippet
and _manually_ attempt to resize it to zero ?
Right. I did include a programmatically resize to zero, and that on it own seems to work fine. It goes wrong with a manual resize.
The testcase as a whole:

package firstopengl ;
import javax.media.opengl.*;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.newt.awt.NewtCanvasAWT;
import javax.swing.JFrame;

/** Will hang on termination after (vertically) manually resizing to zero */
public class SwingNEWTBug implements   GLEventListener {
   public SwingNEWTBug() {          
     GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
     NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
     glWindow.addGLEventListener(this);
     JFrame jFrame = new JFrame("Resize BUG");
     jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     jFrame.add(newtCanvasAWT);
     jFrame.setSize(640, 480);
     jFrame.setVisible(true);
     jFrame.setSize(640, 0); // This is still ok and has no adverse effect.
     jFrame.setSize(640, 200);    
   }
   public void init(GLAutoDrawable drawable) { }  
   public void dispose(GLAutoDrawable drawable) { }
   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
   public void display(GLAutoDrawable drawable) { }
   public static void main(String[] arg) {  new SwingNEWTBug();  }
}

Can you attach a log file w/ all debug flags enabled ?
See the attachment.
log.txt

Guess we are working on this together here.
~Sven
Sure, and keep up the good work.

Job