<?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>411</bug_id>
          
          <creation_ts>2010-09-09 11:01:07 +0200</creation_ts>
          <short_desc>Restore applet support / make jogl usable in managed environments again</short_desc>
          <delta_ts>2010-10-14 23:55:04 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>linux</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Bien">bienator</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
    
    <cc>sgothel</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>774138544e1eec3330309ad682fa05154a07ab8d</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>494</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Bien">bienator</who>
    <bug_when>2010-09-09 11:01:07 +0200</bug_when>
    <thetext>locking optimizations for X11 require the host application to call GLProfile.initSingleton() prior doing any UI work.

This is not acceptable as default behavior since it breaks JOGL in managed environments (Applets, NetBeans RCP, lifecycle containers in general). This kind of optimizations should be an opt-in flag or resolved otherwise before JOGL 2 release.

regression since JOGL 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2010-09-22 05:15:19 +0200</bug_when>
    <thetext>Calling GLProfile.initSingleton() in AbstractUIPlugin makes it work with Eclipse RCP. This workaround does not prevent random GUI freezes on focus lost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>504</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-09-24 05:22:00 +0200</bug_when>
    <thetext>1st manual applet test:

I just tested running the same applet in 2 tabs:
   http://localhost/webstart-next/applet-gears.jnlp
   - Ubuntu 10.04, x86_64
   - Firefox 3.6.11pre-x86_64
   - Oracle Java 6u21-x86_64
   - NVIDIA 260.19.06

both applets running in the same process, and XInitThreads() has been called
_after_ AWT was in use by the applet&apos;s JVM (see below).
Result: It works.

But I have a deadlock or GL Profile not found situation using the plain javaws tool on X11,
will checking that and create a test case simulating this situation.

~Sven

+++

MozillaPlugin.setWindow sun.plugin2.main.server.MozillaPlugin@48e5855a hWndControlWindow = 83887001
MozillaPlugin.setWindow setting applet [AppletID 1] size to 600, 400
JRE 1.6.0.21: Info: XInitThreads() called for concurrent Thread support

JVMInstance.registerApplet for applet ID 2, plugin sun.plugin2.main.server.MozillaPlugin@63b9240e
JVMManager: applet launch (ID [AppletID 2]) succeeded
  Received applet ID [AppletID 2]
MozillaPlugin.setWindow sun.plugin2.main.server.MozillaPlugin@63b9240e hWndControlWindow = 83887533
MozillaPlugin.setWindow setting applet [AppletID 2] size to 600, 400
Spool AppletMessage: sun.plugin2.message.SetAppletSizeMessage@5
JRE 1.6.0.21: Info: XInitThreads() called for concurrent Thread support</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>505</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Bien">bienator</who>
    <bug_when>2010-09-24 07:26:00 +0200</bug_when>
    <thetext>a simple testcase would be:
 - start a non trivial swing application (JFrame, a few buttons etc) without doing any calls to GLProfile.
 - start a JOGL testcase (gears whatever).
 - dispose JOGL
 - dispose Swing

(another testcase: swap step one and two)

only than we could assume that JOGL has no side effects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-09-25 06:12:02 +0200</bug_when>
    <thetext>commit bcad73dccb1cd0c32e3a77b3406ddc74e8f2e4ac

Unit test for Bug 411 (Pre AWT/Swing Usage, Mixed usage with JOGL):
    Added exhausting Pre AWT/Swing usage test utilizing a later JOGL init
    with GLCanvas and NEWTCanvasAWT.
    This works for NV+X11+Ubuntu+64bit, have to do more testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>507</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Bien">bienator</who>
    <bug_when>2010-09-26 04:27:01 +0200</bug_when>
    <thetext>(for the record)
hudson build went through cleanly:
http://jogamp.org/chuck/job/jogl/174/testReport/

I also tested on u64 + ATI</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>510</commentid>
    <comment_count>6</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2010-09-27 04:43:07 +0200</bug_when>
    <thetext>Hi!

It works fine with Cent OS 5.3, Java 1.6 update 17, NVIDIA Quadro FX 3450 supporting OpenGL 2.1.2.

However, it works 50% of the time with Mandriva Linux 2010, Java 1.6 update 21, ATI Radeon 1950 Pro supporting OpenGL 1.3. When it does not work, nothing appears in the log, the window does not appear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>512</commentid>
    <comment_count>7</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2010-09-27 05:12:00 +0200</bug_when>
    <thetext>Gears.jnlp crashes after several focus changes. I have just updated Java, I use now the update 21 and the problem is exactly the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>513</commentid>
    <comment_count>8</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2010-09-27 10:36:47 +0200</bug_when>
    <thetext>I have 2 AWT event queues on my machine when I launch Gears.jnlp :s

I have just used JStack to know where the application is blocked:
&quot;javawsApplicationMain&quot; prio=10 tid=0x0967bc00 nid=0x3f36 in Object.wait() [0x9f5ae000]
   java.lang.Thread.State: WAITING (on object monitor)                                 
        at java.lang.Object.wait(Native Method)                                        
        - waiting on &lt;0xa632ca48&gt; (a com.jogamp.opengl.impl.x11.glx.X11GLXDrawableFactory$ShareableResourceThread)
        at java.lang.Object.wait(Object.java:485)                                                                 
        at com.jogamp.opengl.impl.x11.glx.X11GLXDrawableFactory.&lt;init&gt;(X11GLXDrawableFactory.java:75)             
        - locked &lt;0xa632ca48&gt; (a com.jogamp.opengl.impl.x11.glx.X11GLXDrawableFactory$ShareableResourceThread)    
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)                                  
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)           
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)   
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)                                        
        at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:118)                          
        at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:148)                          
        at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:167)                          
        at javax.media.opengl.GLDrawableFactory.&lt;clinit&gt;(GLDrawableFactory.java:136)                              
        at javax.media.opengl.GLProfile$1.run(GLProfile.java:898)                                                 
        at java.security.AccessController.doPrivileged(Native Method)                                             
        at javax.media.opengl.GLProfile.&lt;clinit&gt;(GLProfile.java:808)                                              
        at javax.media.opengl.awt.GLCanvas.&lt;clinit&gt;(GLCanvas.java:78)                                             
        at demos.gears.Gears.main(Gears.java:32)                                                                  
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                            
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)                          
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)                  
        at java.lang.reflect.Method.invoke(Method.java:597)                                                       
        at com.sun.javaws.Launcher.executeApplication(Launcher.java:1799)                                         
        at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1745)                                           
        at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1507)                                                
        at com.sun.javaws.Launcher.run(Launcher.java:129)                                                         
        at java.lang.Thread.run(Thread.java:619)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>517</commentid>
    <comment_count>9</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-10-14 23:55:04 +0200</bug_when>
    <thetext>    JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11
    
    Changed GLProfile/NativeWindowFactory/.. initialization methodology:
    
        GLProfile:
            public static synchronized void initSingleton(final boolean firstUIActionOnProcess);
    
        NativeWindowFactory:
            public static synchronized void initSingleton(final boolean firstUIActionOnProcess);
    
.. read the rest in the git commit message.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>