Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326087 - StackRenderer arbitrarily changes selected element when MPartStack is being unrendered
Summary: StackRenderer arbitrarily changes selected element when MPartStack is being u...
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.1 M3   Edit
Assignee: Remy Suen CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
: 326688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-23 14:40 EDT by Remy Suen CLA
Modified: 2010-10-26 13:27 EDT (History)
0 users

See Also:


Attachments
PartRenderingEngineTests tests patch v1 (2.25 KB, patch)
2010-09-30 11:56 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-09-23 14:40:25 EDT
1. Open two files.
2. Activate the editor in the back.
3. Restart
4. The file in the wrong is active now. :O
Comment 1 Remy Suen CLA 2010-09-23 14:49:28 EDT
The renderer is changing the selection on shutdown.

Thread [main] (Suspended (breakpoint at line 158 in ElementContainerImpl))	
	PartStackImpl(ElementContainerImpl<T>).setSelectedElement(T) line: 158	
	StackRenderer.hideChild(MElementContainer<MUIElement>, MUIElement) line: 414	
	PartRenderingEngine.removeGui(MUIElement) line: 517	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	ElementReferenceRenderer.disposeWidget(MUIElement) line: 110	
	PartRenderingEngine.removeGui(MUIElement) line: 532	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	PartRenderingEngine.removeGui(MUIElement) line: 528	
	WorkbenchWindow.hardClose(boolean) line: 1355	
	WorkbenchWindow.busyClose(boolean) line: 1059	
	WorkbenchWindow.access$9(WorkbenchWindow, boolean) line: 1038	
	WorkbenchWindow$6.run() line: 1085	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchWindow.close(boolean) line: 1083	
	Workbench$14.run() line: 1048	
	SafeRunner.run(ISafeRunnable) line: 42	
	Workbench.busyClose(boolean) line: 1042	
	Workbench.access$11(Workbench, boolean) line: 956	
	Workbench$15.run() line: 1118	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	Workbench.close(int, boolean) line: 1116	
	Workbench.close() line: 1089	
	WorkbenchWindow.busyClose(boolean) line: 1056	
	WorkbenchWindow.access$9(WorkbenchWindow, boolean) line: 1038	
	WorkbenchWindow$6.run() line: 1085	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchWindow.close(boolean) line: 1083	
	WorkbenchWindow.close() line: 1099	
	WorkbenchWindow$4.close(MWindow) line: 427	
	WBWRenderer$8.shellClosed(ShellEvent) line: 421
Comment 2 Eric Moffatt CLA 2010-09-23 14:54:44 EDT
Remy, is this another one of those cases where it's the StackRenderer 'adjusting' its selected element automatically? If so then perhaps it's time to turf that code and ensure that whenever *we* (the workbench) closes a part that *it* picks another element in the stack to become 'selected' ??
Comment 3 Remy Suen CLA 2010-09-23 15:51:56 EDT
(In reply to comment #2)
> Remy, is this another one of those cases where it's the StackRenderer
> 'adjusting' its selected element automatically?

Yes, it is.
Comment 4 Remy Suen CLA 2010-09-23 15:55:31 EDT
(In reply to comment #2)
> If so then perhaps it's time to
> turf that code and ensure that whenever *we* (the workbench) closes a part that
> *it* picks another element in the stack to become 'selected' ??

Note that the CTabFolder will automatically select another item if you dispose the currently selected item.
Comment 5 Remy Suen CLA 2010-09-30 11:47:48 EDT
*** Bug 326688 has been marked as a duplicate of this bug. ***
Comment 6 Remy Suen CLA 2010-09-30 11:56:29 EDT
Created attachment 179976 [details]
PartRenderingEngineTests tests patch v1
Comment 7 Remy Suen CLA 2010-09-30 14:47:54 EDT
The incorrect placeholder referencing problem described by bug 326688 can lead to some fun duplication of views.

1. Window > Reset Perspective... > OK
2. Drag the 'Problems' view and drop it somewhere.
3. Now you have two 'Problems' view.
Comment 8 Remy Suen CLA 2010-09-30 16:57:18 EDT
(In reply to comment #2)
> If so then perhaps it's time to
> turf that code and ensure that whenever *we* (the workbench) closes a part that
> *it* picks another element in the stack to become 'selected' ??

Based on the other problems that are cropping up due to this issue, I agree that we should just go ahead with this, Eric. The renderers shouldn't try to be smart unless they have to anyway.
Comment 9 Remy Suen CLA 2010-10-04 09:25:20 EDT
Fixed in CVS HEAD.
Comment 10 Remy Suen CLA 2010-10-26 13:27:27 EDT
Verified on Windows XP with I20101025-1602.

The active part does not appear to be preserved though, see bug 328703.