Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365473

Summary: Display#post(Event) confuses mouse buttons 2 and 3 on Cocoa
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, gheorghe, lshanmug, pwebster, Silenio_Quarti
Version: 3.8   
Target Milestone: 3.8 M4   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 357532    
Attachments:
Description Flags
patch none

Description Markus Keller CLA 2011-12-02 14:38:08 EST
Display#post(Event) confuses mouse buttons 2 and 3 on Cocoa.

To reproduce, use Snippet142 but click the right mouse button:

			event.button = 3;

The console says that button 2 has been pressed. With button = 2, the console says button 3.

This works fine on Windows 7 and GTK. If you change Button to Text in the snippet, you see that button 3 correctly opens the context menu.
Comment 1 Felipe Heidrich CLA 2011-12-02 14:57:01 EST
Lakshmi, please take a loot at this problem. Thanks.
Comment 2 Lakshmi P Shanmugam CLA 2011-12-05 06:35:03 EST
Created attachment 207908 [details]
patch

Felipe, can you please review?
Comment 3 Lakshmi P Shanmugam CLA 2011-12-05 06:40:20 EST
The SWT buttons were not mapped correctly to the CG buttons in Display.post(). The patch fixes this.
Comment 4 Felipe Heidrich CLA 2011-12-06 14:41:47 EST
I was not able to apply the patch using (git am) or egit.
Please use 'git format-patch -M origin/master' to create patches.

I copied the patch line-by-line and tested.
It works fine, please release.
Comment 5 Lakshmi P Shanmugam CLA 2011-12-07 03:11:16 EST
(In reply to comment #4)
> I was not able to apply the patch using (git am) or egit.
> Please use 'git format-patch -M origin/master' to create patches.
> 
> I copied the patch line-by-line and tested.
> It works fine, please release.

Sorry Felipe, I'm not sure why it doesn't apply. I created the patch using egit. It applies in my workspace but only after setting ignore leading path segments to 3 ...
Comment 7 Markus Keller CLA 2011-12-07 12:03:06 EST
Could you release this to M4?

The command from bug 357532 is currently broken on other platforms, since the implementation relies on this Mac-specific bug.

Once this fix is declared to go into the next I-build, bug 357532 can be fixed by using "mouseEvent.button = 3;" everywhere.
Comment 8 Lakshmi P Shanmugam CLA 2011-12-07 14:09:58 EST
(In reply to comment #7)
> Could you release this to M4?
> 
> The command from bug 357532 is currently broken on other platforms, since the
> implementation relies on this Mac-specific bug.
> 
> Once this fix is declared to go into the next I-build, bug 357532 can be fixed
> by using "mouseEvent.button = 3;" everywhere.

The fix will be in tonight's build.