<?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>571</bug_id>
          
          <creation_ts>2012-03-30 10:39:27 +0200</creation_ts>
          <short_desc>Wrong Newt MouseEvent behavior on X11</short_desc>
          <delta_ts>2012-04-27 10:28:22 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>x11</component>
          <version>1</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>linux</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>0</everconfirmed>
          <reporter name="Sebastien Schneider">sebastien.schneider</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
    
    <cc>sebastien.schneider</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>4efc9344af1c4aa7d00c7b40e5caf063efdf6080</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1511</commentid>
    <comment_count>0</comment_count>
    <who name="Sebastien Schneider">sebastien.schneider</who>
    <bug_when>2012-03-30 10:39:27 +0200</bug_when>
    <thetext>Hi,
It looks like there is a bug in the modifiers attribute value of the NEWT InputEvent when this one is a MouseEvent and only on X11. The problem is reproducible with a pure NEWT GLWindow or also with a NewtCanvasAWT and can be highlighted by using a TraceMouseAdapter to display the modifiers value.

Actually, on a given event it seems that the modifiers is set to the value of the previous event. Over there  the modifiers value in a MouseEvent on X11 is never set to a combination of button pressed.

Typical use case is: I press button 1, then button 2 and then button 3 without releasing anything and the trace log on X11 (Ubuntu 11.10 64bit) from TraceMouseAdapter is:

MouseEvent[EVENT_MOUSE_PRESSED, [I@4911b910/[I@2a8ceeea, button 1, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 181 / 145 0.0p], InputEvent[modifiers: 0x0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1333096374870 d 0ms]]]
MouseEvent[EVENT_MOUSE_PRESSED, [I@5a02c35e/[I@6b687e7c, button 2, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 181 / 145 0.0p], InputEvent[modifiers: 0x40, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1333096376803 d 0ms]]]
MouseEvent[EVENT_MOUSE_PRESSED, [I@194835fb/[I@53cffeb4, button 3, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 181 / 145 0.0p], InputEvent[modifiers: 0xc0, NEWTEvent[sys:false, source:jogamp.newt.driver.x11.X11Window, when:1333096378004 d 1ms]]]

And the same NEWT code on Windows7 64bits with the same use case, the trace log is:

MouseEvent[EVENT_MOUSE_PRESSED, [I@1723ade0/[I@276c58fe, button 1, count 1, wheel rotation 0, pointer&lt;1&gt;[-1: 193 / 231 0.0p], InputEvent[modifiers:64, NEWTEvent[sys:false, source:jogamp.newt.driver.windows.WindowsWindow, when:1333096612564 d 0ms]]]
MouseEvent[EVENT_MOUSE_PRESSED, [I@3a469fea/[I@72acd989, button 2, count 2, wheel rotation 0, pointer&lt;1&gt;[-1: 193 / 231 0.0p], InputEvent[modifiers:192, NEWTEvent[sys:false, source:jogamp.newt.driver.windows.WindowsWindow, when:1333096612795 d 0ms]]]
MouseEvent[EVENT_MOUSE_PRESSED, [I@e41a242/[I@7703a25d, button 3, count 3, wheel rotation 0, pointer&lt;1&gt;[-1: 193 / 231 0.0p], InputEvent[modifiers:448, NEWTEvent[sys:false, source:jogamp.newt.driver.windows.WindowsWindow, when:1333096612976 d 0ms]]]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1513</commentid>
    <comment_count>1</comment_count>
    <who name="Sebastien Schneider">sebastien.schneider</who>
    <bug_when>2012-03-30 11:19:03 +0200</bug_when>
    <thetext>Sorry I was wrong by saying that &quot;Over there  the modifiers value in a MouseEvent on X11 is never set to a combination of button pressed.&quot;: 0x40+0x80=0xc0. So the button press combination is ok but still shifted one event back.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1555</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-04-27 01:22:41 +0200</bug_when>
    <thetext>Fixed w/ JOGL commit 4efc9344af1c4aa7d00c7b40e5caf063efdf6080

Remark: The behavior described _is_ the original X11 behavior.
However, to align the platform behavior, we now set the button mask of a named button
if the native mouse event.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2012-04-27 10:28:22 +0200</bug_when>
    <thetext>I&apos;ll give it a try very soon. Thank you.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>