Bug 328339 Part activation history seems to ignore detached windows
1. Detach a view. 2. Drag another view into said detached window. 3. Activate the two views alternatively. 4. Close one of them. 5. A part in the workbench window is activated instead of the other view in the detached window.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
assertTrue(partService.isPartVisible(partA1));
		assertTrue(partService.isPartVisible(partB2));
		assertEquals(partA1, partService.getActivePart());
		assertEquals(partB2, shownPart);
	}
	public void testShowPart_Id_VISIBLE2() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		MPartDescriptor partDescriptor = org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicFactoryImpl.eINSTANCE
				.createPartDescriptor();
		partDescriptor.setElementId("partB");
		partDescriptor.setCategory("aCategory");
		application.getDescriptors().add(partDescriptor);
		MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();
		partStack.setElementId("aCategory");
		window.getChildren().add(partStack);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setElementId("partA");
		partStack.getChildren().add(partA);
		partStack.setSelectedElement(partA);
		window.setSelectedElement(partStack);
		application.setSelectedElement(window);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.activate(partA);
		assertEquals(partA, partService.getActivePart());