<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>889</bug_id>
          
          <creation_ts>2013-11-04 15:53:27 +0100</creation_ts>
          <short_desc>GLCanvas disappear when moves between two JFrame</short_desc>
          <delta_ts>2014-01-12 04:29:16 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>awt</component>
          <version>2</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>729</dependson>
    
    <dependson>816</dependson>
    
    <dependson>849</dependson>
    
    <dependson>928</dependson>
    
    <dependson>937</dependson>
          <blocked>906</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Franco">fzanelli</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>bart.adams</cc>
    
    <cc>fzanelli</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>45ce96db65fa7cbfd3bcb3dd4503bc6251d2e493</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3265</commentid>
    <comment_count>0</comment_count>
    <who name="Franco">fzanelli</who>
    <bug_when>2013-11-04 15:53:27 +0100</bug_when>
    <thetext>I wrote a code to move a GLCanvas from a JFrame to another and move it back to the first. If I do this operation more than one time the GLCanvas disappear.
I Experienced this problem with version 2.1.2 on windows 7 x64 platform. With jogl 2.0.2 the problem doesn&apos;t appear. 

This is the application:

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

/**
 *
 * @author Zanelli Franco. &lt;fzanelli@tecnosens.it&gt;
 */
public class JoglFrameError extends JFrame {

    public JoglFrameError() {

        GLProfile profile = GLProfile.get(GLProfile.GL2);
        GLCapabilities glCapabilities = new GLCapabilities(profile);
        final GLCanvas glCanvas = new GLCanvas(glCapabilities);
        final JPanel container = new JPanel(new BorderLayout());
        container.add(glCanvas);

        setLayout(new BorderLayout());
        // create a button that open a new JFrame and move the GLCanvas
        JButton button = new JButton(&quot;Move GlCanvas to new Frame&quot;);
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {                
                final JFrame newFrame = new JFrame();

                // Create a button that move back the GLCanvas to the first frame
                JButton closeBt = new JButton(&quot;Move Back the GLCanvas&quot;);
                closeBt.addActionListener(new ActionListener() {

                    @Override
                    public void actionPerformed(ActionEvent e) {
                        container.add(glCanvas, BorderLayout.CENTER); 
                        glCanvas.setBounds(0,0, container.getSize().width, getSize().height);
                        newFrame.dispose();
                    }
                });

                newFrame.setSize(320, 240);
                newFrame.setLayout(new BorderLayout());
                newFrame.add(closeBt, BorderLayout.NORTH);
                newFrame.add(glCanvas, BorderLayout.CENTER);                
                newFrame.setVisible(true);

            }
        });

        add(button, BorderLayout.NORTH);
        add(container, BorderLayout.CENTER);
        setSize(640, 480);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new JoglFrameError().setVisible(true);
    }
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3266</commentid>
    <comment_count>1</comment_count>
    <who name="Franco">fzanelli</who>
    <bug_when>2013-11-04 16:18:19 +0100</bug_when>
    <thetext>With jogl version 2.1.1, same OS and platform configuration, the problem doesn&apos;t appear. It has been introduced in last release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3296</commentid>
    <comment_count>2</comment_count>
    <who name="Bart Adams">bart.adams</who>
    <bug_when>2013-11-08 10:03:30 +0100</bug_when>
    <thetext>If you call setVisible(true) on the GLCanvas after newFrame.setVisible(true) it should appear again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3310</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-10 19:10:23 +0100</bug_when>
    <thetext>Probably a regression to the fix of Bug 878
jogl git commit 887dbdb34d71a3a266b7854bc9a3842aad1032f9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3311</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-10 20:38:14 +0100</bug_when>
    <thetext>reproduce ..  comment 3 is valid (regression)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3312</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-10 21:02:06 +0100</bug_when>
    <thetext>45ce96db65fa7cbfd3bcb3dd4503bc6251d2e493
    When JAWTWindow&apos;s visibility tracker updates component&apos;s local visibility,
    it should read it&apos;s local visibility state instead &apos;trusting&apos; the passed state.
    
    Make JAWTWindow&apos;s visibility tracker DEBUG output more brief for readability.


Related: Bug 816, Bug 849, Bug 729

Please re-test all unit tests related to above bugs!

com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos01AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos02AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03aB729AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03bB849AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03cB849AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816JTabbedPanelVisibilityB849B878AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816GLCanvasFrameHoppingB849B889AWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos04aAWT
com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos04bAWT

May use scripts/tests.sh via scripts/tests-x64.sh .. etc

Please reopen if recuring regression .. above tests worked fine here on GNU/Linux X11.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>