Bug 922

Summary: Unable to preserve resources during NewtCanvasAWT reparenting
Product: [JogAmp] Newt Reporter: Michael <michael.esemplare>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: 1   
Hardware: All   
OS: windows   
Type: --- SCM Refs:
a00406f289ebaaae8d91e9ccc980829f202421a8 45525950b0ad41b10790515c8b6142d746cd24f5
Workaround: ---
Attachments: Log with newt/jogl debugging

Description Michael 2013-12-11 04:29:11 CET
OS: Windows 7
Multiple monitor setup (Laptop w/ external monitor as primary device)

Setting GLWindow.preserveGLStateAtDestroy(true) has no effect during NewtCanvasAWT reparenting operation. jogamp.newt.WindowImpl uses wasVisible to determine resource preservation on destroy, however NewtCanvasAWT sets the GLWindow invisible before reparenting, thus always destroying GLContext.
Comment 1 Michael 2013-12-11 04:47:29 CET
Created attachment 566 [details]
Log with newt/jogl debugging

The logging describes the following setup. Two GLWindows, one with an animator, the other without. All logging before the "Before Switch" line involves initialization and adding the AnimatedGLWindow to the newtCanvas. After the line logs the switch/destruction of the AnimatedGLWindow for the second GLWindow.
Comment 2 Sven Gothel 2013-12-11 05:35:50 CET
a00406f289ebaaae8d91e9ccc980829f202421a8    
    NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via 
    new method variant using hints:
      - Add REPARENT_HINT_FORCE_RECREATION, covering 'old' forceDestroyCreate boolean argument
      - Add REPARENT_HINT_BECOMES_VISIBLE, Claim window becomes visible after reparenting, 
        which is important for e.g. preserving the GL-states in case window is invisible w
    
    Deprecate other reparentWindow(..) variants w/o hints.
    
    Use only new variant using hints w/o semantical change.

45525950b0ad41b10790515c8b6142d746cd24f5
   NEWT Window.reparentWindow(..): Use REPARENT_HINT_BECOMES_VISIBLE 
   to ensure GL State Preservation ; Add unit test !