Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365473 - Display#post(Event) confuses mouse buttons 2 and 3 on Cocoa
Summary: Display#post(Event) confuses mouse buttons 2 and 3 on Cocoa
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.8   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.8 M4   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 357532
  Show dependency tree
 
Reported: 2011-12-02 14:38 EST by Markus Keller CLA
Modified: 2011-12-09 11:07 EST (History)
5 users (show)

See Also:


Attachments
patch (1.72 KB, patch)
2011-12-05 06:35 EST, Lakshmi P Shanmugam CLA
no flags Details | Diff

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