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
}
		if (element instanceof MContext) {
			IEclipseContext context = ((MContext) element).getContext();
			if (context != null) {
				IEclipseContext newParentContext = modelService
						.getContainingContext(element);
				if (context.getParent() != newParentContext) {
					
					
					context.setParent(newParentContext);
				}
			}
		}
		
		if (element instanceof MPartStack && !element.isVisible()) {
			MWindow window = modelService.getTopLevelWindowFor(element);
			String trimId = element.getElementId() + "(minimized)"; 
			MPerspective persp = modelService.getPerspectiveFor(element);
			if (persp != null)
				trimId = element.getElementId() + '(' + persp.getElementId()
						+ ')';
			MToolControl trimCtrl = (MToolControl) modelService.find(trimId,
					window);
			if (trimCtrl != null)
				trimCtrl.setVisible(true);
		}
		
		if (element instanceof MWindow && element.getWidget() != null) {
			element.setVisible(true);
		}