Multiple reshapes

I’m seeing more than one reshape on startup. Normaly there is a 0,0 0,0 then a 0,0 1118,895. But occasionaly they run the other way around and I get a blank screen…

[Debug][INIT]
[Debug][INIT] Done
[Debug][RESHAPE] (0,0) (1118,895)
[Debug][RESHAPE] Done
[Debug][RESHAPE] (0,0) (0,0)
[Debug][RESHAPE] Done

Cheers
Peter

W2k SP4
Jogl nightly build 2006-03-10
java version “1.5.0_03”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot™ Client VM (build 1.5.0_03-b07, mixed mode)

Do you have a test case? What is the scenario here? Full-screen? Windowed mode?

Fullscreen. I’m using some code I took from the nice canyon demo as far as I remember. I think this only started when I made my init and first frame display code much faster to avoid the garbage on the screen problem I had. (see earlier post).

public final void init(final GLAutoDrawable drawable) {
    Utils.logDebug("[INIT]");
    GLU glu = new GLU();
    GL gl = drawable.getGL();
    //drawable.setGL( new DebugGL(drawable.getGL()));

    // FIXME: hack
    ((Component) drawable).requestFocus();

    // FIXME: workaround for Windows full-screen bug when
    // sun.java2d.noddraw=true
    if (fullScreenSelected) {
        String osName = System.getProperty("os.name");
        if (osName.startsWith("Windows")) {
            if (Boolean.getBoolean("sun.java2d.noddraw")) {
                EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        mainF.setBounds(0, 0, currentDisplayMode.getWidth(), currentDisplayMode.getHeight());
                        drawable.setSize(canvasJP.getWidth(), canvasJP.getHeight());
                        mainF.toFront();
                    }
                });
            }
        }
    }

… rest of init method

I would bet there are race conditions in the full-screen code in the JDK causing the bogus 0,0 reshape event to be sent. I would recommend trying to test perhaps in your display() method whether the width and height are 0,0 and using EventQueue.invokeLater() to put another resize command for your GLCanvas on the event queue if so.