<?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>903</bug_id>
          
          <creation_ts>2013-11-13 19:15:36 +0100</creation_ts>
          <short_desc>NEWT: Support &apos;Continue Drag on Exit&apos;</short_desc>
          <delta_ts>2013-11-17 01:55:05 +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>All</rep_platform>
          <op_sys>all</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>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>88f6e0012b36ca69dedaadb4e403e2a424b20cbf</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3317</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-13 19:15:36 +0100</bug_when>
    <thetext>http://forum.jogamp.org/Making-a-NEWT-mouse-drag-continue-through-a-mouse-exit-tp4030617.html

We have been running into issues with
mouse-drag events when the mouse gets dragged from inside a NEWT canvas to outside it. 
It seems like the drag ought to continue, even while the mouse is outside the canvas, but
instead the canvas stops getting drag events as soon as the mouse exits, even if the mouse
button is still pressed. We see this up through at least JOGL 2.1.2.

We would like to chip in and try to fix the issue, if we can. It&apos;s obvious there&apos;s some
history (1, 2, 3) behind the current behavior, though, so it seems like we should start by
asking for input.

1: &lt;http://forum.jogamp.org/JOGL-661-Wrong-mouseDragged-event-send-by-newt-td3724002.html&gt;
2: &lt;https://jogamp.org/bugzilla/show_bug.cgi?id=556&gt;
3: &lt;https://github.com/sgothel/jogl/commit/8b0aa0e7653f74e713880e77f9afbe59caff38f0&gt;

Specifically, we would like to get NEWT mouse-drags to work like AWT/Swing/SWT mouse-drags --
if the mouse is being dragged, and goes outside the bounds of the component, the component
continues to receive drag events (and, notably, the mouse-up event at the end of the drag). 

+++

Pointer/Mouse events are processed platform agnostic in the methods:

- WindowImpl.doPointerEvent(..)
  - 1st pass - directly invoked by event source

- WindowImpl.consumePointerEvent(..)
  - 2nd pass - before delivery

I have added more detailed impl. documentation:
  &lt;http://jogamp.org/git/?p=jogl.git;a=commitdiff;h=937b29bc3b3d33d2928956ceacbfe55ef77346de&gt;

&quot;continue drag on exit&quot; has simply not been considered [yet],
however it makes sense - and if nobody disagrees I would accept such behavior.

+++

Right now exterior pointer/mouse events maybe discarded in the native methods (Windows touch),
which action we simply can remove (since it is touched).

Both doPointerEvent(..) and consumePointerEvent() shall tolerate the dragged exterior events,
which is possible, since we track the &apos;pointer down&apos; state.

Support of this enhancement requires:
  - Specification (above description seems to be sufficient)
  - Implementation
  - Unit tests</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3325</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-15 14:59:41 +0100</bug_when>
    <thetext>On X11 no extra native code was required, i.e. drag events are received 
even if pointer is in exterior of the window.

Windows behaves different: 
  - Native code for touch processing is required to deal w/ exterior dragging
  - Mouse move/release when exterior of the window is not &apos;just&apos; received.

OSX: TBD ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3326</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-15 15:47:05 +0100</bug_when>
    <thetext>(In reply to comment #1)
&gt; On X11 no extra native code was required, i.e. drag events are received 
&gt; even if pointer is in exterior of the window.
&gt; 
&gt; Windows behaves different: 
&gt;   - Native code for touch processing is required to deal w/ exterior dragging
&gt;   - Mouse move/release when exterior of the window is not &apos;just&apos; received.

We have to SetCapture(HWND) on MOUSE_MOVE if BUTTON is PRESSED
and ReleaseCapture() when no more buttons are pressed or leaving focus.

&gt; 
&gt; OSX: TBD ..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3327</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-15 18:25:26 +0100</bug_when>
    <thetext>(In reply to comment #2)
&gt; &gt; 
&gt; &gt; OSX: TBD ..
On OSX no extra native code was required either, i.e. drag events are received 
even if pointer is in exterior of the window.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3331</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-17 01:55:05 +0100</bug_when>
    <thetext>    - Support &apos;Continue Drag on Exit&apos;
      - Track dragging operation, allow exterior dragging
      - Hence track EXIT (see below)
      - Windows:
        - Capture mouse for exterior dragging
        - Only &apos;NewtWindows_trackPointerLeave&apos; if &apos;entering&apos;
        - Simplify touch: No &apos;inside&apos; check - Not required.
    
    - Consistent Mouse ENTER/EXIT
      - Track ENTER/EXIT and synthesize if required, drop duplicate
      - OSX benefits, since it never produced ENTER/EXIT events
      - AWT (or other TK) translated events beahve equal now.
      - Required for EXIT event after ending exterior dragging and final RELEASE
    
    Tests: Passed unit tests &apos;junit.run.newt.event&apos; on
      - GNU/Linux
      - Windows7
      - OSX 10.7
    
    Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT:
      - GNU/Linux
      - Windows7 (mouse)
      - Windows8.1 (touch)
      - OSX 10.7</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>