Bug 430276 - Two context menus appear on Mac in the diagram editors
Summary: Two context menus appear on Mac in the diagram editors
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 430524
Blocks:
  Show dependency tree
 
Reported: 2014-03-13 07:28 EDT by Christian Damus CLA
Modified: 2017-01-31 08:35 EST (History)
2 users (show)

See Also:


Attachments
Screen captures of the two menus (149.76 KB, image/png)
2014-03-13 07:28 EDT, Christian Damus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2014-03-13 07:28:14 EDT
Created attachment 240859 [details]
Screen captures of the two menus

Current Luna development branch post M6 (Git commit 21408e3 or later).

Two context menus appear in the diagrams, one after the other, on Mac platform.

Steps to reproduce.

1. Open a class diagram.
2. Summon the context menu on a class shape. (Ctrl-click)
3. See a context menu appear as in the image on the left in the attachment.
4. Now, click away from the menu to dismiss it.
5. See a second menu appear as in the image on the right in the attachment.
6. Click away to dismiss this menu.

Note that at step 4 you can alternatively choose an action from the menu, such as "hide element", and the second menu will appear after that action completes.

Note also that the second menu has some items in common with the first but also has some others that the first does not.

This does not happen with the context menu in the Model Explorer and other views.  It is only evident in the diagram surface.
Comment 1 Christian Damus CLA 2014-03-13 09:17:46 EDT
It looks like the second menu that appears is the same one that shows up when summoning the context menu on a tab at the bottom of the editor.  This suggests that the mouse event is somehow being propagated to that tab widget instead of being consumed?  It's a place for me to start investigating, at least.
Comment 2 Christian Damus CLA 2014-03-13 09:37:18 EDT
Right-clicking in the client area of an "Unresolved tab", I get only one menu, which is the "second" menu (the one that is also manifest on the tab handle).
Comment 3 Christian Damus CLA 2014-03-13 17:31:56 EDT
Debugging this, I can see clearly that the right-mouse-button-down event is being processed twice:

  * once by the FigureCanvas, via a stack of controls that don't have menus:
    * a containing FigureCanvas and the Shell
  * again by the CTabFolder, via a stack of controls that don't have menus:
    * some anonymous Composite, a FlyoutPaletteComposite, a RulerComposite, a FigureCanvas,
      another FigureCanvas, and the Shell
      
It would appear that something is causing the right-mouse event not to be consumed by the FigureCanvas the first time, on the Mac platform (I don't see this with the Luna M5 build on Windows, and this problem is older than that on Mac).
Comment 4 Christian Damus CLA 2014-03-17 09:26:26 EDT
I am reducing the severity of this problem because it seems that it only happens in PDE run-time workbenches, not in a normal developer workbench (launched from the Mac Finder).

Moreover, this appears to be a bug in the Eclipse Platform's Cocoa implementation of SWT, because I can reproduce it without any Papyrus or GMF context in the PDE's multi-page manifest editor.  So, I'm punting the problem over to Eclipse UI.