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

Bug 290303

Summary: SWT.MenuDetect event is missing
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
menudetect-impl.diff
none
menudetect-usage.diff none

Description Benjamin Muskalla CLA 2009-09-23 14:11:30 EDT
It would be nice to have a SWT.MenuDetect event (and corresponding Control#addMenuDetectListener) to get events if the user tries to open a context menu either trough mouse click or by pressing the corresponding key on the keyboard.
Comment 1 Benjamin Muskalla CLA 2009-09-23 18:07:25 EDT
Created attachment 147939 [details]
menudetect-impl.diff

Implementation of the MenuDetect event.
One thing we need to check is which coordinates we get on windows for the event if triggered by the keyboard. On GTK, I get the center of the affected widget (width / 2, height / 2).
Comment 2 Benjamin Muskalla CLA 2009-09-23 18:09:01 EDT
Created attachment 147941 [details]
menudetect-usage.diff

Enabled usage of the event in JFace and Workbench. This brings part and perspective menus back. For perspectives, the location is not changed immediately, seems to be an issue with the preference listener. Need to check this again.
Comment 3 Ivan Furnadjiev CLA 2010-02-18 08:05:07 EST
Applied both patches to CVS HEAD with a very minor modifications. On windows the coordinates are always the mouse position in the time when the event is generated.