<?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>643</bug_id>
          
          <creation_ts>2012-11-29 10:31:59 +0100</creation_ts>
          <short_desc>SWT &apos;display.asyncExec(Runnable runnable)&apos; runnable not executed until SWT display disposed on Windows w/ NEWT windows parented (NewtCanvasSWT)</short_desc>
          <delta_ts>2012-12-02 04:25:09 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>pc_x86_64</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>samuel.gratzl</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl 0bb202f2883e1eb82256140f13310046f7b13c62
jogl f0f58e120817b57ed3fb70c238001579a68e4064
jogl 571c21df9310d043b08a4a72064617cbe6eee0fa</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2009</commentid>
    <comment_count>0</comment_count>
    <who name="">samuel.gratzl</who>
    <bug_when>2012-11-29 10:31:59 +0100</bug_when>
    <thetext>see also: http://forum.jogamp.org/NEWT-blocks-SWT-Thread-td4027270.html

It seems to be that the NEWT windows blocks the SWT Thread. 

under https://bitbucket.org/sgratzl/jogltest there is a litte test setup based on 2.0-rc11

the project testjogl3 contains two classes. The first one uses a SWT GLCanvas to render the triangle the other one the NEWT Canvas / Window. 

In both classes a SWT messagebox should appear as soon as the glcontext is initialized, using Display.asyncExec. However only the SWT test case will open the popup, whereas the NEWT test case blocks the SWT thread and after the NEWT window is closed the Messagebox (would) appear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-11-29 16:15:01 +0100</bug_when>
    <thetext>As described w/ the title change, the</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-11-29 16:20:20 +0100</bug_when>
    <thetext>display.asyncExec(Runnable runnable) enqueues the runnable for later execution on the SWT UI thread.

SWT&apos;s impl. shall execute the runnables at display.readAndDispatch().
On Windows, this is performed either while not having anymore native events to dispatch,
or if executing these runnables is allowed w/ native event dispatching (disabled  per default).
Processing the runnables is done in Display/Synchronizer: runAsyncMessages(..).

NewtCanvasSWT does not block SWT&apos;s dispatching,
however none of these runnables gets processed.

The reason is unknown and under investigation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2012</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-11-29 18:22:36 +0100</bug_when>
    <thetext>&lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=0bb202f2883e1eb82256140f13310046f7b13c62&gt;

Bug628: Adding unit-test &apos;TestNewtCanvasSWTBug628ResizeDeadlock&apos; exposing NewtCanvasSWT asyncExec(..) bug w/ native parenting

The unit test shows, that while using JOGL&apos;s SWT GLCanvas Display&apos;s asyncExec(..) works properly,
but w/ NewtCanvasSWT on Windows does not.

NewtCanvasSWT differs w/:
  - Using native parenting [Newt GLWindow to SWT Canvas]
  - Processing native events in own NEWT EDT, w/ own Windows dispatch hook [For the child GLWindow only]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2013</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-11-29 18:23:32 +0100</bug_when>
    <thetext>Should read: Bug643 - not - Bug628</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2022</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-12-02 04:25:09 +0100</bug_when>
    <thetext>Fixed ..

&lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=f0f58e120817b57ed3fb70c238001579a68e4064&gt;

Fix Bug 643: SWT &apos;display.asyncExec(Runnable runnable)&apos; runnable not executed on Windows

Turns out that the NEWT Windows impl. didn&apos;t properly validated the client region @ WM_PAINT
and hence &apos;exhausted&apos; the message pipeline, i.e. never reached an IDLE state.

The latter caused SWT to never reach a point where deferred asyncExec(..) Runnables
got processed.

Besides this SWT effect, this also caused a NEWT window on Windows to always repaint itself (?).

+++

&lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=571c21df9310d043b08a4a72064617cbe6eee0fa&gt;

...

Enhance Bug 643 unit test: Also test NEWT EDT and pre-visible GLWindow.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>