Bug 326087 StackRenderer arbitrarily changes selected element when MPartStack is being unrendered
1. Open two files. 2. Activate the editor in the back. 3. Restart 4. The file in the wrong is active now. :O
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
MUIElement defaultSel = getFirstVisibleElement(parentElement);
			parentElement.setSelectedElement(defaultSel);
		}
	}
	private MUIElement getFirstVisibleElement(
			MElementContainer<MUIElement> stack) {
		
		for (MUIElement mPart : stack.getChildren()) {
			if (mPart.isToBeRendered())
				return mPart;
		}
		return null;
	}
	@Override
	public void hookControllerLogic(final MUIElement me) {
		super.hookControllerLogic(me);
		if (!(me instanceof MElementContainer<?>))
			return;
		final MElementContainer<MUIElement> stack = (MElementContainer<MUIElement>) me;
		
		final CTabFolder ctf = (CTabFolder) me.getWidget();
		ctf.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				
				if (ignoreTabSelChanges)
					return;
				MUIElement ele = (MUIElement) e.item.getData(OWNING_ME);