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

Bug 420902

Summary: [Contributions] View menu disappears after showing the context menu
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED WORKSFORME QA Contact: Daniel Rolka <daniel.rolka>
Severity: normal    
Priority: P3 CC: daniel_megert, dj.houghton
Version: 4.3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Remy Suen CLA 2013-11-01 14:38:48 EDT
We have an Eclipse view where showing the context menu will cause the view's menu to be disposed. This happens on both Shift+F10 and right-clicking.

So it seems some menu item gets its visibility updated to false. The viewMenuUpdater in StackRenderer catches this event. It climbs upwards and finds the MPart since the MPopupMenu's parent is the MPart. Then later it decides to dispose the view's menu after calculations from isMenuVisible(*) returns false.

Thread [main] (Suspended (breakpoint at line 433 in ToolItem))	
	ToolItem.releaseWidget() line: 433	
	ToolItem(Widget).release(boolean) line: 824	
	ToolBar.releaseChildren(boolean) line: 807	
	ToolBar(Widget).release(boolean) line: 815	
	ToolBar(Widget).dispose() line: 450	
	StackRenderer.disposeViewMenu(CTabFolder) line: 548	
	StackRenderer$3.handleEvent(Event) line: 346	
	UIEventHandler$1.run() line: 41	
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 180	
	UISynchronizer.syncExec(Runnable) line: 150	
	Display.syncExec(Runnable) line: 4688	
	E4Application$1.syncExec(Runnable) line: 205	
	UIEventHandler.handleEvent(Event) line: 38	
	EventHandlerWrapper.handleEvent(Event, Permission) line: 197	
	EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197	
	EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1	
	EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230	
	ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 135	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 80	
	UIEventPublisher.notifyChanged(Notification) line: 58	
	HandledMenuItemImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
	HandledMenuItemImpl(UIElementImpl).setVisible(boolean) line: 332	
	ContributionRecord.updateVisibility(IEclipseContext) line: 101	
	MenuManagerRendererFilter.updateElementVisibility(MMenu, MenuManagerRenderer, MenuManager, IEclipseContext, int, boolean) line: 185	
	MenuManagerShowProcessor.showMenu(Menu, MMenu, MenuManager) line: 256	
	MenuManagerShowProcessor.menuAboutToHide(IMenuManager) line: 125	
	MenuManagerEventHelper.showEventPostHelper(MenuManager) line: 54	
	MenuManager.handleAboutToShow() line: 476
Comment 1 DJ Houghton CLA 2014-01-30 11:25:17 EST
We've seen this behaviour both on Windows and Mac OSX.
Comment 2 Eric Moffatt CLA 2014-02-14 15:36:37 EST
Could this be a DUP of bug 427133 ? (this is the 4.3.2 version of a fix we've already put in master for M5).
Comment 3 Dani Megert CLA 2014-02-19 10:59:09 EST
(In reply to Eric Moffatt from comment #2)
> Could this be a DUP of bug 427133 ? (this is the 4.3.2 version of a fix
> we've already put in master for M5).

Remy can you verify that?
Comment 4 Remy Suen CLA 2014-03-11 08:17:31 EDT
(In reply to Dani Megert from comment #3)
> (In reply to Eric Moffatt from comment #2)
> > Could this be a DUP of bug 427133 ? (this is the 4.3.2 version of a fix
> > we've already put in master for M5).
> 
> Remy can you verify that?

It's still broken for me, Dani.

Version: 4.3.2
Build id: M20140221-1700

This was upgraded from 4.3.1 to 4.3.2 using p2. I will download 4.4M6 and try that...
Comment 5 Remy Suen CLA 2014-03-11 08:30:26 EDT
Sorry, I don't think RTC is working properly with 4.4M6 (and possibly 4.4 in general) so I can't test it there. :(
Comment 6 Remy Suen CLA 2014-03-11 14:44:17 EDT
I was able to install the latest RTC milestone into 4.4M6. The problem doesn't exist there anymore. I'm closing this as WORKSFORME. Feel free to duplicate it instead or whatever.

Thanks, guys.