Bug 556

Summary: mouseDragged events is send instead of mouseMoved by newt
Product: [JogAmp] Newt Reporter: jouvieje <jerome.jouvie>
Component: windowsAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: minor    
Priority: ---    
Version: 1   
Hardware: pc_x86_64   
OS: windows   
Type: --- SCM Refs:
8b0aa0e7653f74e713880e77f9afbe59caff38f0
Workaround: ---
Attachments: unit test

Description jouvieje 2012-02-21 18:59:21 CET
mouseDragged events is send instead of mouseMoved by newt (GLWindow) after a drag as ended outside the window. 

Steps to reproduce: 
 * Press mouse button 1 in a window 
 * Drag outside the window 
 * Release mouse button 1
 * Move mouse inside the window => mouseDragged received by newt (with getButton returning 1) instead of mouseMoved 

Workaround:
press and release the mouse button inside the window to stop sending the mouseDragged events instead of mouseMoved.

It seems newt caching internally mouse pressed states and does not update them when event happens outside the window.

This bug does not appear with GLCanvas.
Comment 1 jouvieje 2012-02-21 19:16:41 CET
Created attachment 329 [details]
unit test

unit test
Comment 2 jouvieje 2012-02-22 12:32:06 CET
Additional info:
Windows 7 x64 with NVidia GTX 260 (Driver: 285.62) and JOGL 661
Comment 3 Sven Gothel 2012-04-27 03:54:43 CEST
'Fixed' w/ JOGL commit 8b0aa0e7653f74e713880e77f9afbe59caff38f0

    Bug 556: Newt Mouse Synthetic Drag Event: Clear state if mouse enters/leaves window.
    
    Since we cannot guarantee to have the pressed button information when receiving
    the mouse move event, we synthesize the dragged event (move while mouse button pressed).
    
    To simplify the situation and have a compromise,
    we clear the mouse pressed states when mouse
    enters or leaves the window to remove the dragged events at re-entering.
    
    This seems more sensible, since dragging after re-entering the mouse shall not be expected.