Bug 556 - mouseDragged events is send instead of mouseMoved by newt
Summary: mouseDragged events is send instead of mouseMoved by newt
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: windows (show other bugs)
Version: 1
Hardware: pc_x86_64 windows
: --- minor
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2012-02-21 18:59 CET by jouvieje
Modified: 2012-04-27 03:54 CEST (History)
0 users

See Also:
Type: ---
SCM Refs:
8b0aa0e7653f74e713880e77f9afbe59caff38f0
Workaround: ---


Attachments
unit test (5.37 KB, application/octet-stream)
2012-02-21 19:16 CET, jouvieje
Details

Note You need to log in before you can comment on or make changes to this bug.
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.