Bug 317485 Minimized detached window reappears after switching perspectives
1. Detach the 'Outline' view. 2. Minimize it. 3. Switch perspectives. 4. Switch back. 5. An extra shell for the detached window is visible.
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java
private void showElementRecursive(MUIElement element,
			List<MUIElement> becomingVisible) {
		if (!element.isToBeRendered())
			return;
		if (element instanceof MPlaceholder && element.getWidget() != null) {
			MPlaceholder ph = (MPlaceholder) element;
			MUIElement ref = ph.getRef();
			ref.setCurSharedRef(ph);
			Composite phComp = (Composite) ph.getWidget();
			Control refCtrl = (Control) ph.getRef().getWidget();
			refCtrl.setParent(phComp);
			phComp.layout(new Control[] { refCtrl }, SWT.DEFER);
			if (ref instanceof MPart
					&& ph.getParent().getWidget() instanceof CTabFolder) {
				
				MPart part = (MPart) ref;
				CTabFolder ctf = (CTabFolder) ph.getParent().getWidget();
				MToolBar tbModel = part.getToolbar();
				if (tbModel != null && tbModel.getWidget() != null) {
					ToolBar oldTB = (ToolBar) tbModel.getWidget();
					if (oldTB.getParent() instanceof CTabFolder) {
						CTabFolder oldCTF = (CTabFolder) oldTB.getParent();
						if (oldCTF.getTopRight() == oldTB)
							oldCTF.setTopRight(null);
					}
					oldTB.setParent(ctf);
					ctf.setTopRight(oldTB);
				}
			}
			element = ref;